-
Notifications
You must be signed in to change notification settings - Fork 158
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
Add envoy metrics discovery bundle #5780
Open
atoulme
wants to merge
8
commits into
main
Choose a base branch
from
add_envoy_metrics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
097a7ca
Add envoy metrics discovery bundle
atoulme 739c4d4
add changelog
atoulme 417e5da
use correct image, use endpoint instead of hardcoding the port
atoulme c7999fb
do not skip the test
atoulme 3af3dcb
fix test
atoulme 3245d7e
fix test
atoulme edb80c2
fix test
atoulme 9aef8d3
push envoy discovery to its own test
atoulme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
##################################################################################### | ||
# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. # | ||
# # | ||
# It reflects the default configuration bundled in the Collector executable for use # | ||
# in discovery mode (--discovery) and is provided for reference or customization. # | ||
# Please note that any changes made to this file will need to be reconciled during # | ||
# upgrades of the Collector. # | ||
##################################################################################### | ||
# prometheus: | ||
# enabled: true | ||
# rule: | ||
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)envoy"}) and not (command matches "splunk.discovery") | ||
# host_observer: type == "hostport" and command matches "(?i)envoy" and not (command matches "splunk.discovery") | ||
# k8s_observer: type == "port" and pod.name matches "(?i)envoy" | ||
# config: | ||
# default: | ||
# config: | ||
# scrape_configs: | ||
# - job_name: 'envoy' | ||
# metrics_path: /stats/prometheus | ||
# scrape_interval: 10s | ||
# static_configs: | ||
# - targets: ['`endpoint`'] | ||
# metric_relabel_configs: | ||
# - source_labels: [__name__] | ||
# action: keep | ||
# regex: '(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)' | ||
# status: | ||
# metrics: | ||
# - status: successful | ||
# strict: envoy_cluster_upstream_cx_active | ||
# message: envoy prometheus receiver is working! | ||
# statements: | ||
# - status: failed | ||
# regexp: "connection refused" | ||
# message: The container is not serving http connections. | ||
# - status: failed | ||
# regexp: "dial tcp: lookup" | ||
# message: Unable to resolve envoy prometheus tcp endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM envoyproxy/envoy:v1.32-latest |
35 changes: 35 additions & 0 deletions
35
internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
##################################################################################### | ||
# Do not edit manually! # | ||
# All changes must be made to associated .tmpl file before running 'make bundle.d'. # | ||
##################################################################################### | ||
prometheus: | ||
enabled: true | ||
rule: | ||
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)envoy"}) and not (command matches "splunk.discovery") | ||
host_observer: type == "hostport" and command matches "(?i)envoy" and not (command matches "splunk.discovery") | ||
k8s_observer: type == "port" and pod.name matches "(?i)envoy" | ||
config: | ||
default: | ||
config: | ||
scrape_configs: | ||
- job_name: 'envoy' | ||
metrics_path: /stats/prometheus | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: ['`endpoint`'] | ||
metric_relabel_configs: | ||
- source_labels: [__name__] | ||
action: keep | ||
regex: '(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)' | ||
status: | ||
metrics: | ||
- status: successful | ||
strict: envoy_cluster_upstream_cx_active | ||
message: envoy prometheus receiver is working! | ||
statements: | ||
- status: failed | ||
regexp: "connection refused" | ||
message: The container is not serving http connections. | ||
- status: failed | ||
regexp: "dial tcp: lookup" | ||
message: Unable to resolve envoy prometheus tcp endpoint |
31 changes: 31 additions & 0 deletions
31
internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{ receiver "prometheus" }}: | ||
enabled: true | ||
rule: | ||
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)envoy"}) and not (command matches "splunk.discovery") | ||
host_observer: type == "hostport" and command matches "(?i)envoy" and not (command matches "splunk.discovery") | ||
k8s_observer: type == "port" and pod.name matches "(?i)envoy" | ||
config: | ||
default: | ||
config: | ||
scrape_configs: | ||
- job_name: 'envoy' | ||
metrics_path: /stats/prometheus | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: ['`endpoint`'] | ||
metric_relabel_configs: | ||
- source_labels: [__name__] | ||
action: keep | ||
regex: '(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)' | ||
status: | ||
metrics: | ||
- status: successful | ||
strict: envoy_cluster_upstream_cx_active | ||
message: envoy prometheus receiver is working! | ||
statements: | ||
- status: failed | ||
regexp: "connection refused" | ||
message: The container is not serving http connections. | ||
- status: failed | ||
regexp: "dial tcp: lookup" | ||
message: Unable to resolve envoy prometheus tcp endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the k8s rule intentionally matching just pod name instead of the broader rule used by docker_observer? Istio sidecars for e.g. have pod name like
istio-proxy
, the image name might have envoy in it. But maybe we should only match standalone envoy to startwithThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, you had a note about that. I think we can update the rule to add istio-proxy but then I really need a test showing this works for an istio mesh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am tempted to make a separate integration test with a kind cluster, we deploy everything and we make sure it works. I might get into that next and tweak the rule based on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should merge this one as-is. And have a different item to officially support istio. It is not just the pod name; default prom port used by istio is also not same as the one here. Don't know if it is supported in deiscover mode, but it would be better getting the port/path from the prometheus.io annotations for istio (like we have in our helm chart).