Skip to content

[exporter/loki] The docs for loki.resource.labels is incorrect #15386

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

Closed
Jontem opened this issue Oct 24, 2022 · 3 comments · Fixed by #16088
Closed

[exporter/loki] The docs for loki.resource.labels is incorrect #15386

Jontem opened this issue Oct 24, 2022 · 3 comments · Fixed by #16088
Labels
bug Something isn't working exporter/loki Loki Exporter priority:p2 Medium

Comments

@Jontem
Copy link

Jontem commented Oct 24, 2022

Describe the issue you're reporting

In the example and readme it's shown that loki.resource.labels should be placed under resource processor.

  resource:
    attributes:
    - action: insert
      key: loki.resource.labels
      value: host_name, pod_name

But i couldn't get it to work. Looking at the actual implementation it seems that it looks for resourceHints in log attributes
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/translator/loki/convert.go#L48

// get the hint from the log attributes, not from the resource
// the value can be a single resource name to use as label
// or a slice of string values
if resourcesToLabel, found := logAttrs.Get(hintResources); found {
  labels := convertAttributesToLabels(resAttrs, resourcesToLabel)
  out = out.Merge(labels)
}
@Jontem Jontem added the needs triage New item requiring triage label Oct 24, 2022
@evan-bradley evan-bradley added bug Something isn't working priority:p2 Medium exporter/loki Loki Exporter and removed needs triage New item requiring triage labels Oct 24, 2022
@github-actions
Copy link
Contributor

Pinging code owners: @gramidt @gouthamve @jpkrohling @kovrus @mar4uk. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@kovrus
Copy link
Member

kovrus commented Nov 7, 2022

@Jontem @zirain you are right, it seems like a bug. Do you want to open a pull request with a fix?

@zirain
Copy link
Contributor

zirain commented Nov 23, 2022

cc @kovrus #16088

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/loki Loki Exporter priority:p2 Medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants