Skip to content

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

Open
@ethinx

Description

@ethinx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions