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

Error with Connector Count: Invalid Temporality and Type Combination for Metric in Prometheus Remote Write #37164

Closed
sswieton opened this issue Jan 13, 2025 · 3 comments
Labels
connector/count question Further information is requested

Comments

@sswieton
Copy link

Component(s)

connector/count

What happened?

Description

I'd like to count the number of logs generated by my application and create a new metric in OpenTelemetry Collector that reflects this count
I am using a count connector to generate the metrics
Then metrics are pushed to a Prometheus instance using the Prometheus Remote Write exporter

Actual Result

An error is generated by the Prometheus Remote Write exporter stating: "invalid temporality and type combination for metric 'my.count'".
The metric generated seems to have Aggregation Temporality set to Delta, but I dont' know how to change it to Cumulative in the count connector configuration.
Thanks

Collector version

open-telemetry/opentelemetry-collector 0.115.1

Environment information

Environment

Kubernetes Version: v1.28.12+f154a54

OpenTelemetry Collector configuration

connectors:
    count:
      logs:
        my.count:
          description: "count logs"
          attributes:
            - key: service.name
              default_value: "otel-test-app"      



pipeline:


      ...
      metrics/counts:
        receivers: [count]
        processors: [batch]
        exporters: 
         - prometheusremotewrite
   
      logs:
        receivers:
          - otlp
        processors:
          - attributes/logs
          - k8sattributes/logs
          - batch
        exporters: 
          - otlphttp/loki
          - count

Log output

InstrumentationScope github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector
Metric #0
Descriptor:
-> Name: my.count
-> Description: count logs
-> Unit:
-> DataType: Sum
-> IsMonotonic: true
-> AggregationTemporality: Delta
NumberDataPoints #0
Data point attributes:
-> service.name: Str(otel-test-app)
StartTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 2025-01-10 14:06:07.278717542 +0000 UTC
Value: 1

2025-01-10T14:06:08.279Z debug [email protected]/exporter.go:198 failed to translate metrics, exporting remaining metrics {"kind": "exporter", "data_type": "metrics", "name": "prometheusremotewrite", "error": "invalid temporality and type combination for metric "my.count"", "translated": 1}

Additional context

No response

@sswieton sswieton added bug Something isn't working needs triage New item requiring triage labels Jan 13, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

Hello @sswieton, you can use the deltatocumulative processor to convert delta temporality metrics to cumulative. This would be added in your metrics pipeline.

@crobert-1 crobert-1 added question Further information is requested and removed bug Something isn't working needs triage New item requiring triage labels Jan 14, 2025
@sswieton
Copy link
Author

Thanks for your reply. It works fine with deltatocumulative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connector/count question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants