We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I'm trying a scenario to push metrics from opentelemetry but it's not working. Can you help me? please.
My configurations are:
Note: The GRAFANA_AGENT_URL is: 'http://localhost:4318'
GRAFANA_AGENT_URL
'http://localhost:4318'
import {getNodeAutoInstrumentations} from '@opentelemetry/auto-instrumentations-node'; import {BatchSpanProcessor} from '@opentelemetry/sdk-trace-base'; import {NodeSDK} from '@opentelemetry/sdk-node'; import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-grpc'; import {OTLPMetricExporter} from '@opentelemetry/exporter-metrics-otlp-http'; import {Resource} from '@opentelemetry/resources'; import {ATTR_SERVICE_NAME} from '@opentelemetry/semantic-conventions'; import { //ConsoleMetricExporter, PeriodicExportingMetricReader, } from '@opentelemetry/sdk-metrics'; import {diag, DiagConsoleLogger, DiagLogLevel} from '@opentelemetry/api'; diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG); const traceExporter = new OTLPTraceExporter({ url: process.env.GRAFANA_AGENT_URL, }); const metricOTLPReader = new PeriodicExportingMetricReader({ exporter: new OTLPMetricExporter({ url: process.env.GRAFANA_AGENT_URL, }), exportIntervalMillis: 10000, // Set to 10 seconds for demonstrative purposes only, don't use this in production }); /*const metricConsolePReader = new PeriodicExportingMetricReader({ exporter: new ConsoleMetricExporter(), exportIntervalMillis: 1000, });*/ const sdk = new NodeSDK({ traceExporter, metricReader: metricOTLPReader, resource: new Resource({ [ATTR_SERVICE_NAME]: process.env.SERVICE_NAME, }), spanProcessors: [new BatchSpanProcessor(traceExporter)], instrumentations: [ getNodeAutoInstrumentations({ '@opentelemetry/instrumentation-fs': {enabled: false}, '@opentelemetry/instrumentation-grpc': {enabled: true}, '@opentelemetry/instrumentation-pg': {enabled: false}, '@opentelemetry/instrumentation-express': {enabled: false}, '@opentelemetry/instrumentation-dns': {enabled: false}, '@opentelemetry/instrumentation-net': {enabled: false}, '@opentelemetry/instrumentation-nestjs-core': {enabled: false}, '@opentelemetry/instrumentation-aws-lambda': {enabled: false}, '@opentelemetry/instrumentation-http': { enabled: false, ignoreIncomingRequestHook: (req): boolean => { return req.url === '/health'; }, }, }), ], }); process.on('SIGTERM', () => { void sdk.shutdown(); }); export default sdk;
async function bootstrap() { sdk.start(); ....
const filterRequestsCounter = getMeter().createCounter( `filter_requests_total`, { description: 'Total number of filter requests', unit: 'req', } ); .... filterRequestsCounter.add(1);
In Grafana or Prometheus never I visualized the metric: filter_requests_total *Grafana
filter_requests_total
It's not working. What am I doing wrong?
The text was updated successfully, but these errors were encountered:
Please check the following:
ConsoleMetricExporter
Sorry, something went wrong.
No branches or pull requests
Hi,
I'm trying a scenario to push metrics from opentelemetry but it's not working. Can you help me? please.
My configurations are:
Note: The
GRAFANA_AGENT_URL
is:'http://localhost:4318'
In Grafana or Prometheus never I visualized the metric:
filter_requests_total
*Grafana
It's not working. What am I doing wrong?
The text was updated successfully, but these errors were encountered: