aws-observability / aws-otel-lambda

AWS Distro for OpenTelemetry - AWS Lambda
https://aws-otel.github.io/
Apache License 2.0
149 stars 57 forks source link

Does not work with custom metrics #847

Open stevemao opened 10 months ago

stevemao commented 10 months ago

Describe the bug A clear and concise description of what the bug is.

Metrics is not exported.

Steps to reproduce If possible, provide a recipe for reproducing the error.

Step 1. follow https://aws-otel.github.io/docs/getting-started/lambda/lambda-js All default config. metrics should be exported to log which should be visible on cloudwatch

Step 2. Add

import { metrics } from '@opentelemetry/api';

// Create a meter
export const meter = metrics.getMeter('your-metric-name');

// Define a counter metric
export const requestCounter = meter.createCounter('my-requests', {
  description: 'Counts number of requests processed',
});

requestCounter.add(1, { functionName: context.functionName });

In my lambda

What did you expect to see? A clear and concise description of what you expected to see.

metrics in log which should be in cloudwatch

What did you see instead? A clear and concise description of what you saw instead.

no metrics. I can see traces in xray

What version of collector/language SDK version did you use? Version: (e.g., v0.58.0, v1.11.0, etc)

latest

What language layer did you use? Config: (e.g., Java, Python, etc)

Nodejs

Additional context Add any other context about the problem here.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled

stevemao commented 7 months ago

Not stale

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled

stevemao commented 3 months ago

Not stale

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled

stevemao commented 2 weeks ago

Not stale