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

Bug: getting err-mimir-missing-metric-name when __name__ label is present in the labels list and has the metric name as the value #10309

Open
alex-bondarev-linnovate opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@alex-bondarev-linnovate

What is the bug?

We are receiving the received series has no metric name (err-mimir-missing-metric-name) error when trying to use remote-write endpoint. There are several steps where things could go wrong, we're trying to provide as many details as we can.

How to reproduce it?

  1. download mimir proto file with its dependencies (we had to find all of them because it was not possible to compile just mimir.proto)

https://github.com/grafana/mimir/blob/main/pkg/mimirpb/mimir.proto
https://github.com/gogo/protobuf/blob/master/gogoproto/gogo.proto
https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto

  1. compile all files with --js_out flag

To be able to do that we had to install protoc-gen-js via npm install -g protoc-gen-js, the command that was used is as follows:

protoc --js_out=import_style=commonjs,binary:. mimir.proto gogo.proto descriptor.proto

The command generates CommonJS modules successfully.

  1. import WriteRequest and other classes from compiled mimir_pb.js file and construct the request object . We try to send a custom metric called example_metric and are trying to attach uuid and status as labels.
  2. serialize the object using serializeBinary method
  3. compress the binary data using snappy
  4. add compressed data to the POST request, add the following headers:
"Content-Encoding": "snappy"
"Content-Type": "application/x-protobuf"
"X-Prometheus-Remote-Write-Version": "0.1.0"

What did you think would happen?

Mimir should accept sent payload as it seems to fully qualify the endpoint spec.

What was your environment?

libprotoc version is 3.21.12
OS Ubuntu 24
NodeJS version v18.20.5

Any additional context to share?

When debugging the sent object before sending to Mimir (protobuf-javascript provides .toObject() method) it looks like this:

{
timeseriesList: [
  {
    "labelsList": [
      {
        "name": "__name__",
        "value": "example_metric"
      },
      {
        "name": "status",
        "value": "up"
      },
      {
        "name": "uuid",
        "value": "c4a1d53b-454e-434d-8f93-11f0e9e0d10a"
      }
    ],
    "samplesList": [
      {
        "timestampMs": 1735044676736,
        "value": 1.1
      }
    ],
    "exemplarsList": [],
    "histogramsList": []
  }
]
source: 0
metadataList: [
  {
    "type": 0,
    "metricFamilyName": "example_metric",
    "help": "",
    "unit": ""
  }
]
skipLabelValidation: false
skipLabelCountValidation: false
}
@alex-bondarev-linnovate alex-bondarev-linnovate added the bug Something isn't working label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant