Skip to content

Instantly share code, notes, and snippets.

View AlexanderWert's full-sized avatar

Alexander Wert AlexanderWert

View GitHub Profile
Resource SchemaURL: https://opentelemetry.io/schemas/1.9.0
Resource attributes:
-> container.id: STRING(b0bef663a9fadeb7d49a57cfd633baa12c8a79356fb0ff2312d455c948376c39)
-> host.arch: STRING(amd64)
-> host.name: STRING(b0bef663a9fa)
-> os.description: STRING(Linux 5.10.25-linuxkit)
-> os.type: STRING(linux)
-> process.command_line: STRING(/usr/local/openjdk-18:bin:java -javaagent:/app/opentelemetry-javaagent.jar)
-> process.executable.path: STRING(/usr/local/openjdk-18:bin:java)
-> process.pid: INT(1)
@AlexanderWert
AlexanderWert / ExampleMetricsInstrumentation.java
Created June 23, 2022 09:30
Elastic APM Java agent - Custom metrics in plugins
package co.elastic.apm.example.webserver.plugin;
import co.elastic.apm.agent.sdk.ElasticApmInstrumentation;
import io.micrometer.core.instrument.Metrics;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
@AlexanderWert
AlexanderWert / handler.js
Created March 16, 2022 09:19
Elastic APM - AWS Lambda - Node.js - serverless framework example
'use strict';
module.exports.hello = async (event) => {
return {
statusCode: 200,
body: JSON.stringify(
{
message: 'Go Serverless v3.0! Your function executed successfully!',
input: event,
},