-
Notifications
You must be signed in to change notification settings - Fork 48
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
Otel grafana #544
Open
eduard-melnytskyi
wants to merge
8
commits into
master
Choose a base branch
from
otel-grafana
base: master
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
Otel grafana #544
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3470cd1
Add grafana stack with otel collector.
eduard-melnytskyi 629633c
Fix otel stack configuration and extend documentation.
eduard-melnytskyi d61cd81
Fix otel stack configuration and adjust documentation.
eduard-melnytskyi 7105360
Fixed upstream for grafana service.
eduard-melnytskyi 81ccc7f
Removed unnecessary file.
eduard-melnytskyi b045c70
Added dashboard provisioning.
eduard-melnytskyi 67db332
Update default local dashboard.
eduard-melnytskyi dbe76f0
Expose tempo 3200 on localhost.
eduard-melnytskyi 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
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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,8 @@ | ||
apiVersion: 1 | ||
providers: | ||
- name: 'default' | ||
orgId: 1 | ||
folder: '' | ||
type: file | ||
options: | ||
path: /var/lib/grafana/dashboards |
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,30 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
uid: prometheus | ||
access: proxy | ||
orgId: 1 | ||
url: http://prometheus:9090 | ||
basicAuth: false | ||
isDefault: false | ||
version: 1 | ||
editable: false | ||
jsonData: | ||
httpMethod: GET | ||
- name: Tempo | ||
type: tempo | ||
access: proxy | ||
orgId: 1 | ||
url: http://tempo:3200 | ||
basicAuth: false | ||
isDefault: true | ||
version: 1 | ||
editable: false | ||
apiVersion: 1 | ||
uid: tempo | ||
jsonData: | ||
httpMethod: GET | ||
serviceMap: | ||
datasourceUid: prometheus |
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,16 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
|
||
exporters: | ||
otlp: | ||
endpoint: tempo:4317 | ||
tls: | ||
insecure: true | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
exporters: [otlp] |
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,11 @@ | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
|
||
scrape_configs: | ||
- job_name: 'prometheus' | ||
static_configs: | ||
- targets: ['localhost:9090'] | ||
- job_name: 'tempo' | ||
static_configs: | ||
- targets: ['tempo:3200'] |
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,67 @@ | ||
stream_over_http_enabled: true | ||
server: | ||
http_listen_port: 3200 | ||
# grpc_listen_port: 4317 | ||
log_level: info | ||
|
||
query_frontend: | ||
search: | ||
duration_slo: 5s | ||
throughput_bytes_slo: 1.073741824e+09 | ||
trace_by_id: | ||
duration_slo: 5s | ||
|
||
distributor: | ||
receivers: | ||
jaeger: | ||
protocols: | ||
thrift_http: | ||
thrift_binary: | ||
thrift_compact: | ||
grpc: | ||
zipkin: | ||
otlp: | ||
protocols: | ||
http: | ||
grpc: | ||
opencensus: | ||
|
||
ingester: | ||
max_block_duration: 5m | ||
# max_block_bytes: 100000000 | ||
|
||
compactor: | ||
compaction: | ||
block_retention: 1h | ||
|
||
metrics_generator: | ||
registry: | ||
external_labels: | ||
source: tempo | ||
cluster: docker-compose | ||
storage: | ||
path: /var/tempo/generator/wal | ||
remote_write: | ||
- url: http://prometheus:9090/api/v1/write | ||
send_exemplars: true | ||
traces_storage: | ||
path: /var/tempo/generator/traces | ||
|
||
storage: | ||
trace: | ||
backend: local | ||
wal: | ||
path: /var/tempo/wal | ||
local: | ||
path: /var/tempo/blocks | ||
|
||
overrides: | ||
defaults: | ||
global: | ||
max_bytes_per_trace: 100000000 | ||
ingestion: | ||
max_traces_per_user: 10000 | ||
read: | ||
max_bytes_per_tag_values_query: 100000000 | ||
metrics_generator: | ||
processors: [service-graphs, span-metrics, local-blocks] |
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
2 changes: 2 additions & 0 deletions
2
generator/src/templates/nginx/http/gateway/otel-stack.server.conf.twig
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,2 @@ | ||
{% extends "nginx/http/gateway/server.conf.twig" %} | ||
{% block upstream %}{{ upstream }}:3000{% endblock upstream %} |
1 change: 1 addition & 0 deletions
1
generator/src/templates/service/otel-stack/default/otel-stack.yml.twig
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 @@ | ||
{% include "service/#{engine}/latest/#{engine}.yml.twig" with _context only %} |
97 changes: 97 additions & 0 deletions
97
generator/src/templates/service/otel-stack/latest/otel-stack.yml.twig
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,97 @@ | ||
|
||
# Tempo runs as user 10001, and docker compose creates the volume as root. | ||
# As such, we need to chown the volume in order for Tempo to start correctly. | ||
tempo-init: | ||
image: &tempoImage grafana/tempo:main-1a21818 | ||
user: root | ||
entrypoint: | ||
- "chown" | ||
- "10001:10001" | ||
- "/var/tempo" | ||
volumes: | ||
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/tempo:rw | ||
|
||
tempo: | ||
image: *tempoImage | ||
command: [ "-config.file=/etc/tempo.yaml" ] | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/tempo.yaml:/etc/tempo.yaml | ||
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/tempo:rw | ||
networks: | ||
- private | ||
ports: | ||
- "14268" # jaeger ingest | ||
- "3200:3200" # tempo | ||
- "4317" # otlp grpc | ||
- "4318" # otlp http | ||
- "9411" # zipkin | ||
depends_on: | ||
- tempo-init | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://localhost:3200/metrics" ] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 10s | ||
|
||
collector: | ||
image: otel/opentelemetry-collector:0.86.0 | ||
command: [ "--config=/etc/otel-collector.yaml" ] | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/otel-collector.yaml:/etc/otel-collector.yaml | ||
networks: | ||
- private | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://localhost:13133/health" ] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 10s | ||
ports: | ||
- "4318:4318" | ||
- "4317:4317" | ||
prometheus: | ||
image: prom/prometheus:latest | ||
command: | ||
- --config.file=/etc/prometheus.yaml | ||
- --web.enable-remote-write-receiver | ||
- --enable-feature=exemplar-storage | ||
networks: | ||
- private | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/prometheus.yaml:/etc/prometheus.yaml | ||
ports: | ||
- "9090:9090" | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://localhost:9090/-/healthy" ] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 10s | ||
|
||
grafana: | ||
image: grafana/grafana:11.0.0 | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/grafana-dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/dashboards/:/var/lib/grafana/dashboards/ | ||
networks: | ||
- public | ||
- private | ||
environment: | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
- GF_AUTH_DISABLE_LOGIN_FORM=true | ||
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor | ||
labels: | ||
'spryker.app.name': grafana | ||
'spryker.app.type': hidden | ||
'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} | ||
ports: | ||
- "3000:3000" | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://localhost:3000/" ] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 10s |
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.
This should be put under the
services
node, right? I would include 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 in this case, it is not necessary, as this file is all about configuring the services section.