spring-boot-configuration

This project helps to add AWS EC2 instance id to each telemetry record, that is sent to AppInsights.

License

License

Categories

Categories

Spring Boot Container Microservices AWS PaaS Providers Ant Build Tools Configuration Application Layer Libs config
GroupId

GroupId

com.antonchernyshov.integrations.appinsights.aws.ec2
ArtifactId

ArtifactId

spring-boot-configuration
Last Version

Last Version

0.1
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

spring-boot-configuration
This project helps to add AWS EC2 instance id to each telemetry record, that is sent to AppInsights.
Project URL

Project URL

https://github.com/antonchernyshov/appinsights-aws-ec2-integration
Source Code Management

Source Code Management

https://github.com/antonchernyshov/appinsights-aws-ec2-integration.git

Download spring-boot-configuration

Dependencies

runtime (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-autoconfigure jar 2.3.5.RELEASE
com.microsoft.azure : applicationinsights-spring-boot-starter jar 1.1.1
com.amazonaws : aws-java-sdk-core jar 1.11.896

Project Modules

There are no modules declared in this project.

appinsights-aws-ec2-integration

Using Azure AppInsights to monitor Spring Boot app deployed to AWS EC2(beanstalk, etc.)?

You're not alone!

This project helps to add AWS EC2 instance id to each telemetry record, that is sent to AppInsights.

How to use:

You need to add new dependency to your project.

Here's how to do it:

Gradle

dependencies {

    implementation 'com.antonchernyshov.integrations.appinsights.aws.ec2:spring-boot-configuration:0.1'    
    
}

Maven

<dependency>
  <groupId>com.antonchernyshov.integrations.appinsights.aws.ec2</groupId>
  <artifactId>spring-boot-configuration</artifactId>
  <version>0.1</version>
</dependency>

This will add needed configuration, which Spring Boot will use without additional actions.

Copy and paste :)

If you can not add new dependency to the project - check out the source code and copy 2 classes to your project:

AppInsightsAwsAutoConfiguration and Ec2AwareTelemetryInitializer

Customization

You can customize the name of the property to be used for EC2 Instance ID:

#Customizing EC2 instance id property name
com.antonchernyshov.integrations.appinsights.aws.ec2.property-name=EC2-INSTANCE-ID

Sample project

I created a sample Spring Boot project, mainly for testing purposes. There is a telemetry generator, that generates all kinds of telemetry and sends it to Azure AppInsights.

You can use it for a reference.

Important! Update application.properties with your own instrumentation key.

You can find more details on how to set it up here:

Versions

Version
0.1