![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
opentelemetry-instrumentation-elasticsearch
Advanced tools
open telemetry instrumentation for the `elasticsearch` module
This module provides automatic instrumentation for @elastic/elasticsearch
and follows otel DB Semantic Conventions.
npm install opentelemetry-instrumentation-elasticsearch
For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.
const { NodeTracerProvider } = require('@opentelemetry/node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { ElasticsearchInstrumentation } = require('opentelemetry-instrumentation-elasticsearch');
registerInstrumentations({
traceProvider,
instrumentations: [
new ElasticsearchInstrumentation({
// Config example (all optional)
suppressInternalInstrumentation: false,
moduleVersionAttributeName: 'elasticsearchClient.version',
responseHook: (span, result) => {
span.setAttribute('db.response', JSON.stringify(result));
},
dbStatementSerializer: (operation, params, options) => {
return JSON.stringify(params);
}
})
]
});
Elasticsearch instrumentation has few options available to choose from. You can set the following (all optional):
Options | Type | Default | Description |
---|---|---|---|
suppressInternalInstrumentation | boolean | false | Elasticsearch operation use http/https under the hood. Setting this to true will hide the underlying request spans (if instrumented). |
responseHook | ResponseHook (function) | undefined | Hook called before response is returned, which allows to add custom attributes to span. Function receive params: span result (object) |
dbStatementSerializer | DbStatementSerializer (function) | JSON.stringify({params, options}) | Elasticsearch instrumentation will serialize db.statement using this function response.Function receive params: operation (string)params (object)options (object)Function response must be a string |
moduleVersionAttributeName | string | undefined | If passed, a span attribute will be added to all spans with key of the provided moduleVersionAttributeName and value of the @elastic/elasticsearch version |
Please make sure dbStatementSerializer
is error proof, as errors are not handled while executing this function.
db.operation
attributedb.operation
contain the API function called.
For the full list see API reference.
Few examples:
client.bulk
client.search
client.index
cat.shards
cluster.health
This extension (and many others) was developed by Aspecto with ❤️
FAQs
open telemetry instrumentation for the `elasticsearch` module
The npm package opentelemetry-instrumentation-elasticsearch receives a total of 17,988 weekly downloads. As such, opentelemetry-instrumentation-elasticsearch popularity was classified as popular.
We found that opentelemetry-instrumentation-elasticsearch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.