Skip to content

Commit

Permalink
Update docs with changes from old docs site
Browse files Browse the repository at this point in the history
* docs-sync:
  Fix headers and resource attributes in oltp.adoc
  Sync changes from old docs in dynatrace.adoc
  Sync changes from old docs in datadog.adoc
  Add RabbitMQ Stream to observation/projects.adoc
  Sync concepts.adoc
  Remove extra line from timers.adoc

Closes gh-4611
  • Loading branch information
jonatan-ivanov committed Jan 22, 2024
2 parents cdb584c + b77b214 commit 08cfab0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 33 deletions.
6 changes: 2 additions & 4 deletions docs/modules/ROOT/pages/concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

Micrometer is a metrics instrumentation library for JVM-based applications. It provides a simple facade over the instrumentation clients for the most popular monitoring systems, letting you instrument your JVM-based application code without vendor lock-in. It is designed to add little to no overhead to your metrics collection activity while maximizing the portability of your metrics effort.

Micrometer is _not_ a distributed tracing system or an event logger. In Micrometer 1.10, we do however provide a plugin mechanism that allows you to add capabilities including the tracing features.
Starting from Micrometer 1.10, Micrometer provides the xref:observation.adoc[Observation API] and a plugin mechanism that allows you to add capabilities including the tracing features. You can read more about tracing in the https://docs.micrometer.io/tracing/reference/[Micrometer Tracing documentation].

// TODO: Link to tracing?

For better understanding the differences among these different types of systems (Metrics, Distributed Tracing, and Logging) we recommend Adrian Cole's talk, titled https://www.dotconferences.com/2017/04/adrian-cole-observability-3-ways-logging-metrics-tracing[Observability 3 Ways].
For better understanding the differences among these different types of systems (Metrics, Distributed Tracing, and Logging) we recommend Adrian Cole's talk, titled https://www.dotconferences.com/2017/04/adrian-cole-observability-3-ways-logging-metrics-tracing[Observability 3 Ways]. To learn more about Micrometer Observation API we recommend Tommy Ludwig's and Marcin Grzejszczak's talk, titled https://www.youtube.com/watch?v=fh3VbrPvAjg[Observability of Your Application].

[[concepts-dependencies]]
== Dependencies
Expand Down
1 change: 0 additions & 1 deletion docs/modules/ROOT/pages/concepts/timers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public class ExampleService {

To support `@MeterTag` annotation on method parameters you need to configure the `@TimedAspect` to add the `MeterTagAnnotationHandler`.


[source,java,subs=+attributes]
-----
include::{include-java}/metrics/TimedAspectTest.java[tags=resolvers,indent=0]
Expand Down
17 changes: 4 additions & 13 deletions docs/modules/ROOT/pages/implementations/datadog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,10 @@ DatadogConfig config = new DatadogConfig() {
MeterRegistry registry = new DatadogMeterRegistry(config, Clock.SYSTEM);
----

`DatadogConfig` is an interface with a set of default methods. If, in the implementation of `get(String k)`, rather than returning `null`, you instead bind it to a property source, you can override the default configuration through properties. For example, Micrometer's Spring Boot support binds properties prefixed with `management.metrics.export.datadog` directly to the `DatadogConfig`:

[source, yaml]
----
management.metrics.export.datadog:
apiKey: YOURKEY
# You will probably want disable Datadog publishing in a local development profile.
enabled: true
# The interval at which metrics are sent to Datadog. The default is 1 minute.
step: 1m
----
`DatadogConfig` is an interface with a set of default methods.
If, in the implementation of `get(String k)`, rather than returning `null`, you instead bind it to a property source, you can override the default configuration through properties.
For example, Spring Boot's Micrometer support binds properties directly to the `DatadogConfig`.
See the https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.metrics.export.datadog[Datadog] section in the Spring Boot reference documentation.

`DatadogConfig.hostTag()` specifies a tag key that is mapped to https://docs.datadoghq.com/api/v1/metrics/#submit-metrics[the `host` field] when shipping metrics to Datadog.
For example, if `DatadogConfig.hostTag()` returns `host`, the tag having `host` as its key is used.
Expand Down
44 changes: 31 additions & 13 deletions docs/modules/ROOT/pages/implementations/dynatrace.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ include::_install.adoc[]

== Configuring

For setting up new integrations with Dynatrace, it is recommended to use the latest version of the https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/[Dynatrace Metrics API] (v2).
If you are using Micrometer with Spring Boot, please also refer to the https://www.dynatrace.com/support/help/extend-dynatrace/extend-metrics/ingestion-methods/micrometer/[Dynatrace documentation] and/or the https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.metrics.export.dynatrace[Spring Boot documentation].
For setting up new integrations with Dynatrace, it is recommended to use the latest version of the https://docs.dynatrace.com/docs/shortlink/api-metrics-v2[Dynatrace Metrics API] (v2).
If you are using Micrometer with Spring Boot, please also refer to the https://docs.dynatrace.com/docs/shortlink/micrometer-metrics-ingest[Dynatrace documentation] and/or the https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.metrics.export.dynatrace[Spring Boot documentation].
Dynatrace provides different ways of setting up integrations:

=== Using Dynatrace auto-configuration (preferred) [[bookmark-auto-configuration]]
Expand Down Expand Up @@ -79,7 +79,7 @@ In this default configuration, metrics will be exported to the local OneAgent or
=== Using a custom endpoint

If auto-configuration is not available on the host, both the Dynatrace Metrics API v2 endpoint and an API token have to be specified.
The https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication/[Dynatrace API token documentation] contains more information on how to create an API token.
The https://docs.dynatrace.com/docs/shortlink/api-authentication[Dynatrace API token documentation] contains more information on how to create an API token.
The 'Ingest metrics' (`metrics.ingest`) permission is required on the token in order to ingest metrics.
It is recommended to limit scope to only this permission.

Expand Down Expand Up @@ -135,11 +135,20 @@ management.dynatrace.metrics.export:
api-token: YOUR_METRICS_INGEST_TOKEN
----

=== Meter metadata

Starting with Micrometer 1.12.0, the Dynatrace registry v2 exports meter metadata to Dynatrace.
Currently supported types of metadata are *unit* (called "base unit" in Micrometer) and *description*.
No changes are required to start exporting Metadata to Dynatrace - upgrading to version 1.12.0 or above is enough.
Find more information about metrics metadata in the https://docs.dynatrace.com/docs/shortlink/metric-ingestion-protocol#metadata[Dynatrace documentation].

The export of metrics metadata can be disabled by setting the `exportMeterMetadata` property on the `DynatraceConfig` (see <<bookmark-available-properties, the section on available properties>> below) to `false`.

== API Versions

=== API v2 [[bookmark-apiv2]]

When the API version is configured to `v2`, the registry will send data using the https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/[Metrics API v2].
When the API version is configured to `v2`, the registry will send data using the https://docs.dynatrace.com/docs/shortlink/api-metrics-v2[Metrics API v2].
In order to maintain backwards compatibility, when a `deviceId` is set (which is required for `v1` and not used in `v2`), `v1` is used as the default.
Otherwise, the version defaults to `v2`, and does not have to be set explicitly.
With no endpoint URI and token set, metrics will be exported to the local OneAgent endpoint or, if running in Kubernetes with the Dynatrace operator installed, to the endpoint provided by the operator.
Expand All @@ -149,21 +158,21 @@ Explicitly specifying these will overwrite auto-configuration.
*Minimal configuration with Dynatrace auto-configuration*

In the minimal configuration <<bookmark-auto-configuration, shown above>> (no URI or API token), the v2 registry will attempt to retrieve the endpoint provided by the Dynatrace Kubernetes operator.
If the operator is not set up or does not provide this information, the exporter will attempt to send metrics to the https://www.dynatrace.com/support/help/how-to-use-dynatrace/metrics/metric-ingestion/ingestion-methods/local-api/[local OneAgent metrics ingest endpoint].
Note that this only works if a OneAgent is running on the host and the https://www.dynatrace.com/support/help/how-to-use-dynatrace/metrics/metric-ingestion/ingestion-methods/local-api/#enable-the-oneagent-metric-api[local OneAgent Metric API] is available.
If the operator is not set up or does not provide this information, the exporter will attempt to send metrics to the https://docs.dynatrace.com/docs/shortlink/local-api[local OneAgent metrics ingest endpoint].
Note that this only works if a OneAgent is running on the host and the https://docs.dynatrace.com/docs/shortlink/local-api#enable-the-oneagent-metric-api[local OneAgent Metric API] is available.
If the ingestion port for the local OneAgent was changed to a custom one, the full endpoint URI has to be provided for the URI property (with API token left empty).

*Configuration with URI and API token*

If no auto-configuration is available or the metrics should be sent to a different endpoint (e.g. a different tenant), the Dynatrace v2 exporter can be configured with an explicit endpoint URI and an https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication/[API token].
The https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication/[API token] must have the https://www.dynatrace.com/support/help/shortlink/api-authentication#token-permissions["Ingest metrics"] (`metrics.ingest`) permission set.
If no auto-configuration is available or the metrics should be sent to a different endpoint (e.g. a different tenant), the Dynatrace v2 exporter can be configured with an explicit endpoint URI and an https://docs.dynatrace.com/docs/shortlink/api-authentication[API token].
The https://docs.dynatrace.com/docs/shortlink/api-authentication[API token] must have the https://docs.dynatrace.com/docs/dynatrace-api/basics/dynatrace-api-authentication#token-scopes["Ingest metrics"] (`metrics.ingest`) permission set.
It is recommended to limit scope to only this permission.

The entire Metrics v2 API endpoint URI has to be specified including its path, i.e.: with the path `/api/v2/metrics/ingest` on SaaS and managed deployments, or `/metrics/ingest` for OneAgent endpoints as mentioned in the https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/post-ingest-metrics/[documentation].
The entire Metrics v2 API endpoint URI has to be specified including its path, i.e.: with the path `/api/v2/metrics/ingest` on SaaS and managed deployments, or `/metrics/ingest` for OneAgent endpoints as mentioned in the https://docs.dynatrace.com/docs/shortlink/api-metrics-v2-post-datapoints[documentation].

*Properties available in the v2 exporter* [[bookmark-available-properties]]

When using the https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/[Dynatrace metrics API v2], the following properties can be set:
When using the https://docs.dynatrace.com/docs/shortlink/api-metrics-v2[Dynatrace metrics API v2], the following properties can be set:

[source,java]
----
Expand Down Expand Up @@ -213,6 +222,12 @@ DynatraceConfig dynatraceConfig = new DynatraceConfig() {
return false;
}
// Only available in Micrometer 1.12.0 and above
@Override
public boolean exportMeterMetadata() {
return true;
}
@Override
@Nullable
public String get(String k) {
Expand Down Expand Up @@ -255,11 +270,14 @@ management.dynatrace.metrics.export:
# Set to false, this will restore the previous (1.8.x) behavior for Timers and DistributionSummaries.
use-dynatrace-summary-instruments: true
# (since 1.12.0) Determines whether meter metadata (unit, description) should be exported.
export-meter-metadata: true
# The export interval in which metrics are sent to Dynatrace (default: 60s).
step: 60s
----

For more information about the metadata picked up by the Dynatrace metadata enrichment feature, see https://www.dynatrace.com/support/help/how-to-use-dynatrace/metrics/metric-ingestion/ingestion-methods/enrich-metrics/[the Dynatrace documentation].
For more information about the metadata picked up by the Dynatrace metadata enrichment feature, see https://docs.dynatrace.com/docs/shortlink/enrichment-files[the Dynatrace documentation].

In Micrometer 1.9.0, Dynatrace-specific summary instruments (`DynatraceTimer` and `DynatraceDistributionSummary`) were introduced.
These specialized instruments are tailored to the Dynatrace metrics ingest, and prevent the creation of invalid metrics.
Expand All @@ -268,11 +286,11 @@ No action is needed from users upgrading to 1.9.0. If there is a discrepancy in

=== API v1 (Legacy) [[bookmark-apiv1]]

When the apiVersion is configured to `v1`, the registry will send data using the https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v1/custom-metrics/[Dynatrace Timeseries API v1 for custom metrics].
When the apiVersion is configured to `v1`, the registry will send data using the https://docs.dynatrace.com/docs/shortlink/api-custom-metrics[Dynatrace Timeseries API v1 for custom metrics].
If a `deviceId` is specified, it will default to `v1` for backwards compatibility with earlier setups.
The `device-id` property is required for `v1` and not used in `v2`.
Existing setups will continue to work when updating to newer versions of Micrometer.
The reported metrics will be assigned to https://www.dynatrace.com/support/help/dynatrace-api/environment-api/topology-and-smartscape/custom-device-api/report-custom-device-metric-via-rest-api/[custom devices] in Dynatrace.
The reported metrics will be assigned to https://docs.dynatrace.com/docs/shortlink/api-custom-device-report-metric[custom devices] in Dynatrace.

For the v1 API, do not specify the ingest path, but only the base URL of your environment, e.g.: `uri: https://\{your-environment-id}.live.dynatrace.com`

Expand Down
6 changes: 4 additions & 2 deletions docs/modules/ROOT/pages/implementations/otlp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ management:
# Supported configs
url: "https://otlp.example.com:4318/v1/metrics"
aggregationTemporality: "cumulative"
headers: "header1=value1"
resourceAttributes: "key=value"
headers:
header1: value1
resourceAttributes:
key1: value1
----

1. `url` - The URL to which data will be reported. Defaults to `http://localhost:4318/v1/metrics`
Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/observation/projects.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Micrometer Observation is used to instrument various projects. Below you can fin
| OkHttp | https://github.com/micrometer-metrics/micrometer/tree/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/okhttp3[Repo]
| OpenFeign | https://github.com/OpenFeign/feign/pull/1760[PR]
| RabbitMQ | https://github.com/rabbitmq/rabbitmq-java-client/issues/952[Issue]
| RabbitMQ Stream | https://github.com/rabbitmq/rabbitmq-stream-java-client/pull/384[PR]
| Resilience4j | https://github.com/resilience4j/resilience4j/pull/1698[PR]
| R2DBC | https://github.com/r2dbc/r2dbc-proxy/issues/122[Issue]
| Reactor | https://micrometer.io/docs/observation#instrumentation_of_reactive_libraries[Docs]
Expand Down

0 comments on commit 08cfab0

Please sign in to comment.