Skip to content

Conversation

pipiland2612
Copy link
Contributor

@pipiland2612 pipiland2612 commented Jul 23, 2025

Which problem is this PR solving?

Description of the changes

  • Add "mapstructure:tls" to promcfg
  • Add corresponding unit test

How was this change tested?

  • CI

Checklist

@pipiland2612 pipiland2612 requested a review from a team as a code owner July 23, 2025 17:55
@pipiland2612 pipiland2612 requested a review from joe-elliott July 23, 2025 17:55
@dosubot dosubot bot added the area/storage label Jul 23, 2025
@pipiland2612
Copy link
Contributor Author

When I use this configuration:

metric_backends:
  prom:
    prometheus:
      endpoint: https://example.com
      normalize_calls: true
      normalize_duration: true
      token_file_path: /tokens/prometheus_token
      token_override_from_context: true
      tls:
        insecure: false
        ca_file: /tls/ca.crt 

Here's are the logs that I get (I don't have any /ca/ca.crt file):

...
jaeger-1      | 2025-07-23T17:59:26.262Z        info    extensions/extensions.go:69     Stopping extensions...  {"resource": {"service.instance.id": "791e4767-c8f7-4969-b32d-2f4651f56aba", "service.name": "jaeger", "service.version": "v2.8.0"}}
jaeger-1      | 2025-07-23T17:59:26.262Z        info    [email protected]/service.go:336 Shutdown complete.      {"resource": {"service.instance.id": "791e4767-c8f7-4969-b32d-2f4651f56aba", "service.name": "jaeger", "service.version": "v2.8.0"}}
jaeger-1      | Error: failed to start extensions: cannot create metrics reader failed to load TLS config: failed to load CA CertPool File: failed to load cert /ca/ca.crt: open /ca/ca.crt: no such file or directory
jaeger-1      | 2025/07/23 17:59:26 failed to start extensions: cannot create metrics reader failed to load TLS config: failed to load CA CertPool File: failed to load cert /ca/ca.crt: open /ca/ca.crt: no such file or directory

Copy link

codecov bot commented Jul 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.45%. Comparing base (4d6ac93) to head (73ff053).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7367      +/-   ##
==========================================
+ Coverage   96.44%   96.45%   +0.01%     
==========================================
  Files         375      375              
  Lines       22871    22871              
==========================================
+ Hits        22058    22061       +3     
+ Misses        615      613       -2     
+ Partials      198      197       -1     
Flag Coverage Δ
badger_v1 9.21% <ø> (ø)
badger_v2 1.74% <ø> (ø)
cassandra-4.x-v1-manual 11.96% <ø> (ø)
cassandra-4.x-v2-auto 1.73% <ø> (ø)
cassandra-4.x-v2-manual 1.73% <ø> (ø)
cassandra-5.x-v1-manual 11.96% <ø> (ø)
cassandra-5.x-v2-auto 1.73% <ø> (ø)
cassandra-5.x-v2-manual 1.73% <ø> (ø)
elasticsearch-6.x-v1 16.80% <ø> (ø)
elasticsearch-7.x-v1 16.85% <ø> (ø)
elasticsearch-8.x-v1 16.99% <ø> (ø)
elasticsearch-8.x-v2 1.74% <ø> (ø)
grpc_v1 10.46% <ø> (ø)
grpc_v2 1.74% <ø> (ø)
kafka-3.x-v1 9.37% <ø> (ø)
kafka-3.x-v2 1.74% <ø> (ø)
memory_v2 1.74% <ø> (ø)
opensearch-1.x-v1 16.89% <ø> (ø)
opensearch-2.x-v1 16.89% <ø> (ø)
opensearch-2.x-v2 1.74% <ø> (ø)
opensearch-3.x-v2 1.74% <ø> (ø)
query 1.74% <ø> (ø)
tailsampling-processor 0.48% <ø> (ø)
unittests 95.43% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pipiland2612 pipiland2612 changed the title Add mapstructure for prometheus-tls Add tls mapstructure for promcfg Jul 23, 2025
@pipiland2612 pipiland2612 changed the title Add tls mapstructure for promcfg Add tls mapstructure for promcfg/config.go Jul 23, 2025
@yurishkuro yurishkuro changed the title Add tls mapstructure for promcfg/config.go Add missing mapstructure tag for TLS in promcfg/config.go Jul 23, 2025
Signed-off-by: pipiland2612 <[email protected]>
@pipiland2612 pipiland2612 requested a review from yurishkuro July 23, 2025 19:00
@yurishkuro yurishkuro added this pull request to the merge queue Jul 23, 2025
@yurishkuro
Copy link
Member

Thanks!

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 23, 2025
@yurishkuro yurishkuro added this pull request to the merge queue Jul 23, 2025
Merged via the queue into jaegertracing:main with commit 2319df2 Jul 23, 2025
62 checks passed
@pipiland2612 pipiland2612 deleted the Fix_Pormetheus_config_bug branch July 24, 2025 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: TLS options for Prometheus are leading to crash when specified in a YAML configuration file
2 participants