Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Copyright 2017 VMware, Inc.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.micrometer.boot2.samples;

import io.micrometer.boot2.samples.components.PersonController;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(scanBasePackageClasses = PersonController.class)
@EnableScheduling
public class DynatraceSampleV1 {
public static void main(String[] args) {
// WARNING:
// This example uses the Dynatrace v1 registry, which uses the former Timeseries v1 API.
// It is suggested to use the current v2 registry instead, which exports to the Metrics API v2.
new SpringApplicationBuilder(DynatraceSampleV1.class).profiles("dynatrace-v1").run(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

@SpringBootApplication(scanBasePackageClasses = PersonController.class)
@EnableScheduling
public class DynatraceSample {
public class DynatraceSampleV2 {
public static void main(String[] args) {
new SpringApplicationBuilder(DynatraceSample.class).profiles("dynatrace").run(args);
new SpringApplicationBuilder(DynatraceSampleV2.class).profiles("dynatrace-v2").run(args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Copyright 2017 VMware, Inc.
# <p>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://www.apache.org/licenses/LICENSE-2.0
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

###################################################################################################
# WARNING:
# This example uses the Dynatrace v1 registry, which uses the former Timeseries v1 API.
# It is suggested to use the current v2 registry instead, which exports to the Metrics API v2.
###################################################################################################

management.metrics.export.dynatrace:
enabled: true

uri: "https://{your-environment-id}.live.dynatrace.com"
# uri: "https://{your-domain}/e/{your-environment-id}" for managed deployments

api-token: "YOUR_TOKEN" # should be read from a secure property source

# The v1 exporter requires a device name.
device-id: "YOUR_DEVICE_NAME"
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

management.metrics.export.dynatrace:
enabled: true
apiToken: my-api-token
uri: https://my-environment-id.live.dynatrace.com
deviceId: my-custom-device
api-version: v2

# If you are not using the OneAgent on your host, additionally specify your Dynatrace environment and API token:
uri: "https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/ingest"
# uri: "https://{your-domain}/e/{your-environment-id}/api/v2/metrics/ingest" for managed deployments

api-token: "YOUR_TOKEN" # should be read from a secure property source