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

feat: flagd OTEL collector #586

Merged
merged 9 commits into from
Apr 10, 2023

Conversation

Kavindu-Dodan
Copy link
Contributor

@Kavindu-Dodan Kavindu-Dodan commented Apr 3, 2023

This PR

Fixes #563

Introduce configurations for flagd to connect to OTEL collector. Also, improves how telemetry configurations are handled.

Changes include,

  • Package renaming - otel to telemetry - This avoids import conflicts

  • Introduce a telemetry builder - The intention is to have a central location to handle telemetry configurations and build telemetry components

  • Introduce a span processor builder - Provide groundwork for OTel Traces for evaluation in flagd #575 (needs fallback mechanism)

How to test?

Consider following this guide - (doc generated from commit) https://github.com/open-feature/flagd/blob/81c66b3c89540b475fe0a46ac89869800f7b74ae/docs/configuration/flagd_telemetry.md

In short,

  • create configuration files (docker-compose yaml, collector config yaml, Prometheus yaml )
  • start collector setup (docker-compose up)
  • start flagd with otel collector override for metrics (flagd start --uri file:/flags.json --metrics-exporter otel --otel-collector-target localhost:4317)

Metrics will be available at Prometheus(http://localhost:9090/graph). Traces are still missing as we have to implement them.

@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Merging #586 (b7c1123) into main (d78a3d9) will decrease coverage by 0.15%.
The diff coverage is 65.21%.

@@            Coverage Diff             @@
##             main     #586      +/-   ##
==========================================
- Coverage   70.91%   70.77%   -0.15%     
==========================================
  Files          21       22       +1     
  Lines        2187     2248      +61     
==========================================
+ Hits         1551     1591      +40     
- Misses        577      592      +15     
- Partials       59       65       +6     
Impacted Files Coverage Δ
core/pkg/runtime/from_config.go 58.62% <0.00%> (-1.03%) ⬇️
...ore/pkg/service/flag-evaluation/connect_service.go 66.17% <ø> (ø)
core/pkg/service/flag-evaluation/flag_evaluator.go 68.34% <ø> (ø)
...ore/pkg/service/middleware/metrics/http_metrics.go 76.25% <ø> (ø)
core/pkg/telemetry/builder.go 68.42% <68.42%> (ø)
core/pkg/telemetry/metrics.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

core/pkg/telemetry/metrics.go Show resolved Hide resolved
core/pkg/telemetry/metrics.go Outdated Show resolved Hide resolved
core/pkg/telemetry/global.go Outdated Show resolved Hide resolved
core/pkg/telemetry/global.go Outdated Show resolved Hide resolved
@Kavindu-Dodan Kavindu-Dodan marked this pull request as ready for review April 5, 2023 20:26
@Kavindu-Dodan Kavindu-Dodan requested a review from a team as a code owner April 5, 2023 20:26
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
docs/configuration/flagd_start.md Outdated Show resolved Hide resolved
docs/configuration/flagd_start.md Outdated Show resolved Hide resolved
Kavindu-Dodan and others added 2 commits April 6, 2023 08:11
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an OTel expert, but this looks fine to me and I trust @bacherfl and @thisthat 's expertise.

@Kavindu-Dodan Kavindu-Dodan merged commit 494bec3 into open-feature:main Apr 10, 2023
@github-actions github-actions bot mentioned this pull request Apr 10, 2023
@github-actions github-actions bot mentioned this pull request Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support OTel collector in flagd
4 participants