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

Beyla gRPC support for the sample #101

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions recipes/beyla-golden-signals/beyla-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ spec:
requests:
cpu: 10m
memory: 100Mi
limits:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated, but I hit it once or twice. It seems better not to have the memory limit

memory: 500Mi
image: grafana/beyla:1.5.2
securityContext:
seccompProfile:
Expand Down
41 changes: 7 additions & 34 deletions recipes/beyla-golden-signals/collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,46 +39,19 @@ spec:
- resource.attributes["k8s.pod.name"] == nil
# not relevant to the GKE applications dashboard. You can comment the line below to
# pass through all metrics generated by Beyla
- name != "http.server.request.duration"
# Transform metrics to match GMP http server conventions:
# https://cloud.google.com/stackdriver/docs/managed-prometheus/exporters/server/http
transform/prometheusconventions:
metric_statements:
- context: metric
statements:
# Create a count metric from the duration histogram and rename it to http_requests
- extract_count_metric(true) where name == "http.server.request.duration"
- set(unit, "1") where name == "http.server.request.duration_count"
- set(name, "http_requests") where name == "http.server.request.duration_count"
# Rename duration histogram
- set(name, "http_request_duration") where name == "http.server.request.duration"
- context: datapoint
statements:
- set(attributes["code"], attributes["http.response.status_code"])
- delete_key(attributes, "http.response.status_code")
- set(attributes["method"], attributes["http.request.method"])
- delete_key(attributes, "http.request.method")
# GMP metrics are expected to be double
- set(value_double, Double(value_int))
resource/podinstance:
attributes:
- key: pod
from_attribute: k8s.pod.name
action: upsert
- key: service.instance.id
from_attribute: k8s.pod.uid
action: upsert
- name != "http.server.request.duration" and name != "rpc.server.duration"
datapoint:
# Some gRPC metrics appear not to have an RPC method.
- metric.name == "rpc.server.duration" and attributes["rpc.method"] == ""
# Some HTTP metrics appear not to have an http method.
- metric.name == "http.server.request.duration" and attributes["http.request.method"] == ""
aabmass marked this conversation as resolved.
Show resolved Hide resolved
exporters:
googlemanagedprometheus:
metric:
resource_filters:
- regex: 'pod'
googlecloud:
logging:
loglevel: debug
service:
pipelines:
metrics:
receivers: [otlp]
processors: [resource/podinstance, filter, transform/prometheusconventions, resourcedetection]
processors: [filter, resourcedetection]
exporters: [logging, googlemanagedprometheus]
2 changes: 0 additions & 2 deletions recipes/beyla-service-graph/beyla-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ spec:
requests:
cpu: 10m
memory: 100Mi
limits:
memory: 500Mi
image: grafana/beyla:1.5.2
securityContext:
seccompProfile:
Expand Down
22 changes: 15 additions & 7 deletions recipes/beyla-service-graph/collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,28 @@ spec:
http:
connectors:
# convert spans into a calls metric
spanmetrics/httpservicegraph:
spanmetrics/servicegraph:
histogram:
disable: true
dimensions:
- name: server.address
- name: client.address
exclude_dimensions: ['status.code', 'span.kind', 'span.name', 'service.name']
exclude_dimensions:
- 'status.code'
- 'span.kind'
- 'span.name'
- 'service.name'
- 'rpc.method'
- 'rpc.system'
- 'rpc.grpc.status_code'
- 'server.port'
processors:
# filter down to only non-local http server spans
filter/httpserveronly:
filter/serveronly:
error_mode: ignore
traces:
span:
- attributes["http.request.method"] == nil
- attributes["http.request.method"] == nil and attributes["rpc.method"] == nil
- kind.string != "Server"
- attributes["server.address"] == "127.0.0.1"
# detect gke resource attributes
Expand Down Expand Up @@ -112,10 +120,10 @@ spec:
pipelines:
traces:
receivers: [otlp]
processors: [filter/httpserveronly]
exporters: [spanmetrics/httpservicegraph]
processors: [filter/serveronly]
exporters: [spanmetrics/servicegraph]
metrics:
receivers: [spanmetrics/httpservicegraph]
receivers: [spanmetrics/servicegraph]
processors:
- groupbyattrs
- transform/k8spodname_to_server
Expand Down
Loading