mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
updated
This commit is contained in:
parent
1d316f0c1f
commit
a6fbee38a6
2 changed files with 73 additions and 0 deletions
51
observability/config.river
Normal file
51
observability/config.river
Normal file
|
@ -0,0 +1,51 @@
|
|||
//Basic authentication
|
||||
otelcol.auth.basic "grafana_auth" {
|
||||
username = env("GRAFANA_CLOUD_INSTANCE_ID")
|
||||
password = env("GRAFANA_CLOUD_API_TOKEN")
|
||||
}
|
||||
|
||||
|
||||
// Define the 'Receiver' ingesting the data sent out from our app
|
||||
otelcol.receiver.otlp "default" {
|
||||
// configures the default grpc endpoint "0.0.0.0:4317"
|
||||
grpc { }
|
||||
// configures the default http/protobuf endpoint "0.0.0.0:4318"
|
||||
http { }
|
||||
|
||||
|
||||
output {
|
||||
traces = [otelcol.processor.batch.default.input]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//The 'processor' optimizes the network throughput by batching the output
|
||||
otelcol.processor.batch "default" {
|
||||
output {
|
||||
traces = [otelcol.exporter.otlp.digma.input,otelcol.exporter.otlphttp.grafana_cloud.input]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Our two exporters will send the data both to Digma (to analytize our code observability, and to our Grafana cloud instance
|
||||
|
||||
|
||||
otelcol.exporter.otlp "digma" {
|
||||
// Send traces to Digma without TLS enabled.
|
||||
client {
|
||||
endpoint = env("DIGMA_OTLP_ENDPOINT")
|
||||
|
||||
|
||||
tls {
|
||||
insecure = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
otelcol.exporter.otlphttp "grafana_cloud" {
|
||||
client {
|
||||
endpoint = env("GRAFANA_CLOUD_OTLP_ENDPOINT")
|
||||
auth = otelcol.auth.basic.grafana_auth.handler
|
||||
}
|
||||
}
|
22
observability/docker-compose.yml
Normal file
22
observability/docker-compose.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
version: "3.6"
|
||||
services:
|
||||
grafana-agent:
|
||||
image: grafana/agent:latest
|
||||
restart: always
|
||||
command:
|
||||
- run
|
||||
- --server.http.listen-addr=0.0.0.0:12345
|
||||
- /etc/agent/config.river
|
||||
volumes:
|
||||
- ./config.river:/etc/agent/config.river
|
||||
ports:
|
||||
- "12345:12345"
|
||||
- "4317:4317"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
environment:
|
||||
- AGENT_MODE=flow
|
||||
- DIGMA_OTLP_ENDPOINT=host.docker.internal:5050
|
||||
- GRAFANA_CLOUD_OTLP_ENDPOINT=--REPLACE_WITH_ENDPOINT--
|
||||
- GRAFANA_CLOUD_API_TOKEN=${GRAFANA_CLOUD_API_TOKEN}
|
||||
- GRAFANA_CLOUD_INSTANCE_ID=--REPLACE_WITH_INSTANCE_ID--
|
Loading…
Reference in a new issue