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

[모니터링] trace 에 tail sampling 달기 #247

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 82 additions & 2 deletions infra/helm/monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,46 @@ openobserve-collector:
metric:
- resource.attributes["k8s.namespace.name"]!=nil and resource.attributes["k8s.namespace.name"]!="scc"
- resource.attributes["namespace"]!=nil and resource.attributes["namespace"]!="scc"
tail_sampling:
decision_wait: 10s
num_traces: 100
expected_new_traces_per_sec: 10
policies: [
{
# Rule 1: low sampling for readiness/liveness probes
name: team_a-probe,
type: and,
and:
{
and_sub_policy:
[
{
# filter by route
name: route-live-ready-policy,
type: string_attribute,
string_attribute:
{
key: http.route,
values: [ /livez, /readyz, /** ],
enabled_regex_matching: false,
},
},
{
# apply probabilistic sampling
name: probabilistic-policy,
type: probabilistic,
probabilistic: { sampling_percentage: 0.1 },
},
],
},
},
{
# Rule 2: always sample if there is an error
Copy link
Contributor

Choose a reason for hiding this comment

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

좋네요

name: trace-status-policy,
type: status_code,
status_code: { status_codes: [ ERROR ] },
},
]
resourcedetection:
detectors: [system, env, k8snode]
override: true
Expand Down Expand Up @@ -365,7 +405,7 @@ openobserve-collector:
exporters: [otlphttp/openobserve]
traces:
receivers: [otlp]
processors: [batch, k8sattributes, filter/keep-scc]
processors: [batch, k8sattributes, tail_sampling]
exporters: [otlphttp/openobserve]

gateway:
Expand Down Expand Up @@ -558,6 +598,46 @@ openobserve-collector:
metric:
- resource.attributes["k8s.namespace.name"]!="scc"
- resource.attributes["namespace"]!="scc"
tail_sampling:
decision_wait: 10s
num_traces: 100
expected_new_traces_per_sec: 10
policies: [
{
# Rule 1: low sampling for readiness/liveness probes
name: team_a-probe,
type: and,
and:
{
and_sub_policy:
[
{
# filter by route
name: route-live-ready-policy,
type: string_attribute,
string_attribute:
{
key: http.route,
values: [ /livez, /readyz, /** ],
enabled_regex_matching: false,
},
},
{
# apply probabilistic sampling
name: probabilistic-policy,
type: probabilistic,
probabilistic: { sampling_percentage: 0.1 },
},
],
},
},
{
# Rule 2: always sample if there is an error
name: trace-status-policy,
type: status_code,
status_code: { status_codes: [ ERROR ] },
},
]
resourcedetection:
detectors: [env]
override: true
Expand Down Expand Up @@ -691,5 +771,5 @@ openobserve-collector:
exporters: [otlphttp/openobserve]
traces:
receivers: [otlp]
processors: [batch, k8sattributes, resourcedetection, filter/keep-scc]
processors: [batch, k8sattributes, resourcedetection, tail_sampling]
exporters: [otlphttp/openobserve, spanmetrics, servicegraph]
Loading