Skip to content

Instantly share code, notes, and snippets.

View cyrille-leclerc's full-sized avatar

Cyrille Le Clerc cyrille-leclerc

View GitHub Profile
@cyrille-leclerc
cyrille-leclerc / metrics-aggregation-rules.json
Last active August 1, 2023 16:01
Mimir Adaptive Metrics Aggregation Rules for App O11y
[
{
"metric": "traces_service_graph_request_client_seconds_bucket",
"drop_labels": [
"__metrics_gen_instance"
],
"aggregations": [
"sum:counter"
]
},
@cyrille-leclerc
cyrille-leclerc / console.log
Last active May 12, 2023 08:54
install grafana agent flow on mac
$ brew tap grafana/grafana
==> Tapping grafana/grafana
Cloning into '/opt/homebrew/Library/Taps/grafana/homebrew-grafana'...
remote: Enumerating objects: 269, done.
remote: Counting objects: 100% (49/49), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 269 (delta 37), reused 23 (delta 23), pack-reused 220
Receiving objects: 100% (269/269), 64.21 KiB | 2.92 MiB/s, done.
Resolving deltas: 100% (148/148), done.
@cyrille-leclerc
cyrille-leclerc / grafana-agent.flow
Created April 18, 2023 16:23
Grafana Agent Flow OTLP config template
otelcol.receiver.otlp "default" {
grpc {
endpoint = "0.0.0.0:4317"
}
output {
metrics = [otelcol.processor.batch.default.input]
logs = [otelcol.processor.batch.default.input]
traces = [otelcol.processor.batch.default.input]
}
}
@cyrille-leclerc
cyrille-leclerc / search_traces.json
Created March 29, 2023 19:49
Tempo API Search Traces
{
"traces": [
{
"traceID": "111f5594ff52b1f917f4deca8e38243a",
"rootServiceName": "frontend",
"rootTraceName": "GET /api/products/{id}",
"startTimeUnixNano": "1680118368360666000",
"durationMs": 1,
"spanSet": {
"spans": [
cat 1_springboot_app.log.log | promtail --config.file 2_promtail.yml --stdin  --inspect -config.expand-env  -dry-run &> 3_promtail_dryrun_output.log
@cyrille-leclerc
cyrille-leclerc / spring-boot-otel-agent-1.13.0-startup-logs.log
Created April 21, 2022 13:41
Spring Boot Otel Java Agent 1.13.0 Startup logs - `MetricStorageRegistry - Found duplicate metric definition...`
export OTEL_EXPORTER_OTLP_ENDPOINT: http://localhost:4317
export OTEL_RESOURCE_ATTRIBUTES=service.name=anti-fraud-service,service.namespace=com-shoppingcart,service.version=1.0-SNAPSHOT,deployment.environment=production
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
java -javaagent:./../.otel/opentelemetry-javaagent-1.13.0.jar -Dotel.experimental.sdk.metrics.debug=true -Dserver.port=8081 -jar target/anti-fraud-1.0-SNAPSHOT.jar
[otel.javaagent 2022-04-21 15:06:05:405 +0200] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 1.13.0
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
@cyrille-leclerc
cyrille-leclerc / jenkins-package-failure.log
Last active April 15, 2022 16:06
Jenkins mvn package Failure
$ git rev-parse --short HEAD
7ea7de949d
$ mvn -version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /usr/local/Cellar/maven/3.8.5/libexec
Java version: 11.0.11, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "11.3", arch: "x86_64", family: "mac"
@cyrille-leclerc
cyrille-leclerc / elastic-apm-java-agent-startup-logs.log
Created March 23, 2022 13:54
`log_ecs_reformatting=SHADE` doesn't see my Spring Boot SLF4J log file
+ java -javaagent:target/agent/elastic-apm-agent-1.30.0.jar -Dserver.port=8081 -jar target/anti-fraud-1.0-SNAPSHOT.jar
2022-03-23 14:02:19,469 [main] DEBUG co.elastic.apm.agent.util.ExecutorUtils - A new thread named `elastic-apm-configuration-reloader` was created. The original context class loader of this thread (jdk.internal.loader.ClassLoaders$AppClassLoader@2c13da15) has been overridden
2022-03-23 14:02:19,513 [main] DEBUG co.elastic.apm.agent.util.ExecutorUtils - A new thread named `elastic-apm-metadata-0` was created. The original context class loader of this thread (jdk.internal.loader.ClassLoaders$AppClassLoader@2c13da15) has been overridden
2022-03-23 14:02:19,513 [main] DEBUG co.elastic.apm.agent.util.ExecutorUtils - A new thread named `elastic-apm-metadata-1` was created. The original context class loader of this thread (jdk.internal.loader.ClassLoaders$AppClassLoader@2c13da15) has been overridden
2022-03-23 14:02:19,517 [elastic-apm-metadata-1] DEBUG co.elastic.apm.agent.util.ExecutorUtils - A ne
@cyrille-leclerc
cyrille-leclerc / trace-spans.json
Created February 2, 2022 16:42
trace-spans.json
[
{
"_index":".ds-traces-apm-default-2022.01.18-000001",
"_id":"qjzpun4BrJRD8EU3sw0_",
"_version":1,
"_score":null,
"fields":{
"span.name":[
"Phase: Finalise"
],