Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregated metrics disappear in repo after updating metric labels in codebase pjs #202

Open
ethinx opened this issue Dec 12, 2024 · 0 comments
Labels

Comments

@ethinx
Copy link
Contributor

ethinx commented Dec 12, 2024

Issue

As subject, change the metric definition in codebase, add extra labels and update the codebase, the metrics lost in the repo aggregated result, however the metric in worker's /metrics got updated accordingly as expected.

Please take a look if it's intentional behavior or a bug?

Version

1.5.8

Reproducible procedures

  1. Create a codebase and start repo with initial code, and start a worker
var counter = new stats.Counter('test_counter', ['label_one'])
var taskPipe = pipeline($=>$
  .onStart([new Data, new StreamEnd])
  .handleData(
    function (data) {
      counter.withLabels('is_a_value').increase()
    }
  )
)

function metric() {
  Promise.all(
    [taskPipe.spawn()]
  )
  .then(()=>new Timeout(1).wait())
  .then(metric)
}

metric()

pipy()
.listen(1881)
# pipy --init-repo=/path/to/the/codebase/dir/parent
# pipy --admin-port=6061 http://localhost:6060/repo/metrics-issue/
  1. update the pjs and add new label label_two to the metric, then update codebase
var counter = new stats.Counter('test_counter', ['label_one', 'label_two'])
var taskPipe = pipeline($=>$
  .onStart([new Data, new StreamEnd])
  .handleData(
    function (data) {
      counter.withLabels('is_a_value', 'value2').increase()
    }
  )
)

function metric() {
  Promise.all(
    [taskPipe.spawn()]
  )
  .then(()=>new Timeout(1).wait())
  .then(metric)
}

metric()

pipy()
.listen(1881)

The test_counter will disappear in the repo's /metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant