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

[metricstarttimeprocessor] Identify resource by hash of all attributes #38286

Closed
dashpole opened this issue Mar 1, 2025 · 1 comment · Fixed by #38326
Closed

[metricstarttimeprocessor] Identify resource by hash of all attributes #38286

dashpole opened this issue Mar 1, 2025 · 1 comment · Fixed by #38326
Assignees
Labels

Comments

@dashpole
Copy link
Contributor

dashpole commented Mar 1, 2025

Component(s)

metricstarttime processor

Describe the issue you're reporting

Currently, the implementation of true reset points in the prometheusreceiver only uses service.name and service.instance.id to identify a resource:

_, found := rm.Resource().Attributes().Get(semconv.AttributeServiceName)

This logic is being copied to the metricstarttime processor in #37855. However, this logic is prometheus-specific, and should use a hash of all resource attributes instead of just those two.

Possible solutions

This identity library may be helpful here: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/6ea0ea7e0423dd5271cc4ef1b6bde21d6f598412/internal/exp/metrics/identity.

Alternatively, we could use hash/fnv, similar to https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/19c4db6ea12211308fbd2cba12cc8665a5b7c890/exporter/collector/internal/datapointstorage/datapointcache.go#L250. This is similar to how the prometheus server constructs hashes of labels.

Copy link
Contributor

github-actions bot commented Mar 1, 2025

Pinging code owners for processor/metricstarttime: @dashpole @ridwanmsharif. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label.

@dashpole dashpole added enhancement New feature or request and removed needs triage New item requiring triage labels Mar 1, 2025
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 4, 2025
…meCache

Fixes open-telemetry#38286.

This change decouples the processor from the prometheus receiver
concepts.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 4, 2025
…meCache

Fixes open-telemetry#38286.

This change decouples the processor from the prometheus receiver
concepts.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 4, 2025
…meCache

Fixes open-telemetry#38286.

This change decouples the processor from the prometheus receiver
concepts.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 4, 2025
…meCache

Fixes open-telemetry#38286.

This change decouples the processor from the prometheus receiver
concepts.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
@atoulme atoulme closed this as completed in d4e0421 Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants