Skip to content

Commit

Permalink
style(OpenTelemetry): Added minor modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaenam committed Jun 2, 2023
1 parent 9213608 commit 08917a6
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,33 @@ You can collect metrics from any [software that exposes Prometheus metrics](http
If you're looking for help with other collector use cases, see the [newrelic-opentelemetry-examples](https://github.com/newrelic/newrelic-opentelemetry-examples) repository.
</Callout>

Complete the steps below to collect Prometheus metrics:
Complete the steps below to collect Prometheus metrics.

## Step 1: Sign up for your free account if you haven't already [#signup]

<InlineSignup />

## Step 2: Prerequisites [#prerequisites]

The collector will use the Prometheus receiver component
The collector will use the Prometheus receiver component.

Depending on the software you want to monitor the prerequites may change. Prometheus metrics endpoint could be enabled by defaut or may need some setup in the configuration to enable it.
Others software can require a [third-party Prometheus exporter](https://prometheus.io/docs/instrumenting/exporters/#third-party-exporters) to expose metrics.

In both cases the Prometheus metrics endpoint needs to be accesible from the OpenTelemetry Collector.
In both cases, the Prometheus metrics endpoint needs to be accesible from the OpenTelemetry Collector.

## Step 3: Install Opentelemetry collector [#install-opentelemetry-collector]

If not done yet, download and install the Opentelemetry collector following [Opentelemetry docs](https://opentelemetry.io/docs/collector/getting-started/).

Download and install the Opentelemetry collector following [Opentelemetry docs](https://opentelemetry.io/docs/collector/getting-started/).

You will need to install [OpenTelemetry Collector Contrib Distro](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) or other distribution including, at least, the following components:
Install [OpenTelemetry Collector Contrib Distro](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) or other distribution including, at least, the following components:

* [Prometheus receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver)
* [OTLP exporter](https://pkg.go.dev/go.opentelemetry.io/collector/exporter/otlpexporter)

## Step 4: Configure Opentelemetry collector [#configure-opentelemetry-collector]

Update or create a new file called `config.yaml` from the example below.

Replace the following keys in the file with your own values:
Update or create a new file called `config.yaml` and replace the following keys in the file with your own values:

* Prometheus scrape config:
* `PROMETHEUS_JOBNAME`
Expand Down Expand Up @@ -89,17 +85,15 @@ For further configuration options, please review:

## Step 4: Run the collector [#run-collector]

Run the Opentelemetry collector (the way to run it may vary depending on the chosen installation method). Example:
Run the Opentelemetry collector. The way to run it may vary depending on the chosen installation method. Example:

```yaml
/usr/bin/otelcol --config ./config.yaml
```

## Step 5: Find and use your data

### Explore your data

You may use the [metrics explorer](/docs/query-your-data/explore-query-data/browse-data/introduction-data-explorer) to check the metrics being ingested. All metrics reported by the OTEL Prometheus receiver can be detected by running the following query.
You may use the [metrics explorer](/docs/query-your-data/explore-query-data/browse-data/introduction-data-explorer) to check the metrics being ingested. All metrics reported by the OTEL Prometheus receiver are detected by running the following query.

```sql
SELECT count(*)
Expand All @@ -117,7 +111,7 @@ FACET metricName

Prometheus metrics based dashboards and entities use Prometheus metrics naming conventions to match the metrics being reported by the Prometheus endpoints. However, the OpenTelemetry Prometheus receiver uses OpenTelemetry naming conventions by default after [v076.3](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.76.3).

To use Prometheus metrics naming conventions, disable the `pkg.translator.prometheus.NormalizeName` `feature-gate` when running the OpenTelemetry collector:
To use Prometheus metrics naming conventions, disable the feature-gate `pkg.translator.prometheus.NormalizeName` when running the OpenTelemetry collector:

```shell
otelcol-contrib --config ./config.yaml --feature-gates=-pkg.translator.prometheus.NormalizeName
Expand Down

0 comments on commit 08917a6

Please sign in to comment.