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

Mismatch in resource attributes between metrics and everything else #12021

Closed
jaronoff97 opened this issue Jan 6, 2025 · 3 comments · Fixed by #11611
Closed

Mismatch in resource attributes between metrics and everything else #12021

jaronoff97 opened this issue Jan 6, 2025 · 3 comments · Fixed by #11611
Labels
bug Something isn't working

Comments

@jaronoff97
Copy link
Contributor

Describe the bug
When setting up the collector's self-telemetry, I found that metrics emit different resource attributes than the other signals.

Steps to reproduce

  1. download a collector v0.116.0 binary
  2. run the config provided
  3. grep for service.instance.id in the outputs to discover differing IDs

What did you expect to see?
A single and consistent service.instance.id in self-telemetry

What did you see instead?

logs service.instance.id: ca53d844-128d-4358-8978-8702c6bf3aad
traces service.instance.id: ca53d844-128d-4358-8978-8702c6bf3aad
opamp service.instance.id: ca53d844-128d-4358-8978-8702c6bf3aad
metrics service.instance.id: d768bfb1-6707-4b57-a96a-c89da7255388

What version did you use?
v0.116.0

What config did you use?

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch:

exporters:
  debug:
    verbosity: detailed

service:
  telemetry:
    logs:
      processors:
        - batch:
            exporter:
              otlp:
                protocol: http/protobuf
                endpoint: http://localhost:4318/
    # push own metrics to the internal_metrics receiver
    traces:
      processors:
        - batch:
            exporter:
              otlp:
                protocol: grpc/protobuf
                endpoint: http://localhost:4317/
    metrics:
      level: detailed
      readers:
        - periodic:
            interval: 30000
            exporter:
              otlp:
                protocol: grpc/protobuf
                endpoint: localhost:4317
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]

    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]

    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]

Environment
Mac OS 15.1

Additional context

@jaronoff97 jaronoff97 added the bug Something isn't working label Jan 6, 2025
@jaronoff97
Copy link
Contributor Author

I believe the issue is:
resource.New is called twice, once here where it's used for the go-contrib config package and once here only for meter provider

@jaronoff97
Copy link
Contributor Author

I'm happy to work on the fix here

@jaronoff97
Copy link
Contributor Author

will be solved by #11611

github-merge-queue bot pushed a commit that referenced this issue Jan 24, 2025
This PR does a couple of things that I couldn't quite split up so I put
together a PR w/ individual commits to help reviewers get through it.
This PR does the following:

1. update `go.opentelemetry.io/contrib/config` package to latest. this
brings in breaking changes. in order to prevent those breaking changes
from impacting end users, i've also added a layer of config unmarshaling
2. updates the collector to instantiate the meter provider (and
exporters) via the config package. this allows us to remove all the code
in `otelinit`. the reason for including this change was that
unmarshaling the config was causing circular dependencies i didn't want
to address by moving code that could be deleted around.


Replacement for
#11458.

Fixes
#12021

---------

Signed-off-by: Alex Boten <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant