Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
ee36ce4
Add copilot review instructions
trask Aug 23, 2025
2d183c3
Add copilot coding agent setup steps
trask Aug 24, 2025
b5f02e3
Convert JUnit assertions to AssertJ assertions
trask Aug 24, 2025
eaf81b1
Merge branch 'copilot-coding-agent-setup-steps' into copilot-base
trask Aug 24, 2025
82b7a98
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
a294423
visibility
trask Aug 24, 2025
b152bd9
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
066eb13
Also add basic coding agent instructions
trask Aug 24, 2025
f5aa241
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
b71cc41
clarifications
trask Aug 24, 2025
28b6706
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
52463e1
update
trask Aug 24, 2025
d6a15c2
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
218f229
fix
trask Aug 24, 2025
a6a3626
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
ae9711b
more
trask Aug 24, 2025
e3d1086
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
3631faa
refine
trask Aug 24, 2025
9adec91
Merge branch 'add-copilot-review-instructions' into copilot-base
trask Aug 24, 2025
5633e28
Initial plan
Copilot Aug 25, 2025
b2b7241
Initial plan
Copilot Aug 25, 2025
dd1b569
Initial plan
Copilot Aug 25, 2025
3d3f5dd
Initial plan
Copilot Aug 25, 2025
9284308
Update aws-resources module to follow style guide: add @AutoService a…
Copilot Aug 25, 2025
9c32923
Update aws-xray module to follow style guide - static imports and fin…
Copilot Aug 25, 2025
09009ae
Update aws-xray-propagator module to follow style guide
Copilot Aug 25, 2025
560015d
Add static imports for Level constants to follow style guide
Copilot Aug 25, 2025
39a1016
Initial plan
Copilot Aug 25, 2025
5334f76
Update azure-resources module to follow style guide
Copilot Aug 25, 2025
8b9093c
Initial plan
Copilot Aug 25, 2025
b8e651a
Initial plan
Copilot Aug 25, 2025
11ac72c
Initial plan
Copilot Aug 25, 2025
028c35f
Update baggage-processor module to follow style guide conventions
Copilot Aug 25, 2025
f70ef7c
Initial plan
Copilot Aug 25, 2025
3f4682c
Update cloudfoundry-resources module to follow style guide
Copilot Aug 25, 2025
6eff7de
Initial plan
Copilot Aug 25, 2025
662bb2f
Initial plan
Copilot Aug 25, 2025
7189107
Fix style guide violations in gcp-resources module
Copilot Aug 25, 2025
0089d88
Update disk-buffering module to follow style guide recommendations
Copilot Aug 25, 2025
cce615a
Initial plan
Copilot Aug 25, 2025
bd65945
Make public classes final and improve static imports in tests
Copilot Aug 25, 2025
b6abce3
Initial plan
Copilot Aug 25, 2025
d327d07
Changes before error encountered
Copilot Aug 25, 2025
4fcc5f4
Initial plan
Copilot Aug 25, 2025
22c66a0
Changes before error encountered
Copilot Aug 25, 2025
b1d4cb6
Initial plan
Copilot Aug 25, 2025
ae1ba06
Update jfr-events module to follow style guide: fix static imports an…
Copilot Aug 25, 2025
7733e29
Initial plan
Copilot Aug 25, 2025
ed702b8
Changes before error encountered
Copilot Aug 25, 2025
29e80fe
Initial plan
Copilot Aug 25, 2025
96a81b4
Add final keyword to public classes in kafka-exporter
Copilot Aug 25, 2025
966c75a
Initial plan
Copilot Aug 25, 2025
1a33013
Initial plan
Copilot Aug 25, 2025
a45a340
Add static imports and make classes final according to style guide
Copilot Aug 25, 2025
1c7f591
Initial plan
Copilot Aug 25, 2025
cb2bad4
Make public classes final to follow style guide
Copilot Aug 25, 2025
cd603cc
Initial plan
Copilot Aug 25, 2025
3fe560b
Changes before error encountered
Copilot Aug 25, 2025
df24d71
Initial plan
Copilot Aug 25, 2025
2fd695b
Initial plan
Copilot Aug 25, 2025
3bff64f
Changes before error encountered
Copilot Aug 25, 2025
008b8ba
Update FilteringLogRecordProcessor to follow style guide
Copilot Aug 25, 2025
6330da2
Initial plan
Copilot Aug 25, 2025
ace4e6b
Initial plan
Copilot Aug 25, 2025
c3fb6d2
Update prometheus-client-bridge to follow style guide static imports …
Copilot Aug 25, 2025
f5aedb4
Update span-stacktrace module to follow style guide: make classes fin…
Copilot Aug 25, 2025
96945d1
Update samplers module to follow style guide
Copilot Aug 25, 2025
713859b
Merge PR #414: Update span-stacktrace module to follow style guide
trask Aug 25, 2025
3d6ecdd
Merge PR #412: Update samplers module to follow style guide
trask Aug 25, 2025
0679c82
Merge PR #410: [WIP] Update resource-providers module to follow style…
trask Aug 25, 2025
2fb8293
Merge PR #408: Update prometheus-client-bridge module to follow style…
trask Aug 25, 2025
b667d57
Merge PR #406: Update processors module to follow style guide
trask Aug 25, 2025
139bd7a
Merge PR #404: [WIP] Update opamp-client module to follow style guide
trask Aug 25, 2025
7d3bc95
Merge PR #402: Update noop-api module to follow style guide
trask Aug 25, 2025
e2f5581
Merge PR #400: [WIP] Update micrometer-meter-provider module to follo…
trask Aug 25, 2025
ef2831d
Merge PR #398: [WIP] Update maven-extension module to follow style guide
trask Aug 25, 2025
ab61e65
Merge PR #396: [WIP] Update kafka-exporter module to follow style guide
trask Aug 25, 2025
b5bbe7b
Merge PR #394: [WIP] Update jmx-scraper module to follow style guide
trask Aug 25, 2025
64a92cb
Merge PR #392: [WIP] Update jmx-metrics module to follow style guide
trask Aug 25, 2025
c1db80c
Merge PR #390: Update jfr-events module to follow style guide
trask Aug 25, 2025
308752a
Merge PR #388: [WIP] Update jfr-connection module to follow style guide
trask Aug 25, 2025
d5cf543
Merge PR #386: [WIP] Update inferred-spans module to follow style guide
trask Aug 25, 2025
5d4eaf5
Merge PR #384: Update ibm-mq-metrics module to follow style guide
trask Aug 25, 2025
da71bc1
Merge PR #382: Update gcp-resources module to follow style guide
trask Aug 25, 2025
c62f23e
Merge PR #380: [WIP] Update gcp-auth-extension module to follow style…
trask Aug 25, 2025
304edd3
Merge PR #378: Update disk-buffering module to follow style guide rec…
trask Aug 25, 2025
2c31a65
Merge PR #376: Update cloudfoundry-resources module to follow style g…
trask Aug 25, 2025
87f76e0
Merge PR #374: Update baggage-processor module to follow style guide
trask Aug 25, 2025
7b2ef70
Merge PR #372: Update azure-resources module to follow style guide
trask Aug 25, 2025
9b675c1
Merge PR #370: Update aws-xray-propagator module to follow style guide
trask Aug 25, 2025
a30ec54
Merge PR #368: Update aws-xray module to follow style guide
trask Aug 25, 2025
b93781a
Merge PR #366: Update aws-resources module to follow style guide
trask Aug 25, 2025
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
38 changes: 38 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copilot Instructions for OpenTelemetry Java Contrib

This repository provides observability instrumentation for Java applications.

## Code Review Priorities

### Style Guide Compliance

**PRIORITY**: Verify that all code changes follow the [Style Guide](../docs/style-guide.md). Check:

- Code formatting (auto-formatting, static imports, class organization)
- Java language conventions (`final` usage, `@Nullable` annotations, `Optional` usage)
- Performance constraints (hot path allocations)
- Implementation patterns (SPI registration, configuration conventions)
- Gradle conventions (Kotlin DSL, plugin usage, module naming)
- Documentation standards (README files, deprecation processes)

### Critical Areas

- **Public APIs**: Changes affect downstream users and require careful review
- **Performance**: Instrumentation must have minimal overhead
- **Thread Safety**: Ensure safe concurrent access patterns
- **Memory Management**: Prevent leaks and excessive allocations

### Quality Standards

- Proper error handling with appropriate logging levels
- OpenTelemetry specification and semantic convention compliance
- Resource cleanup and lifecycle management
- Comprehensive unit tests for new functionality

## Coding Agent Instructions

When implementing changes or new features:

1. Follow all [Style Guide](../docs/style-guide.md) conventions and the Code Review Priorities above
2. Run tests to ensure they still pass (use `./gradlew test` and `./gradlew integrationTest` as needed)
3. **Always run `./gradlew spotlessApply`** after making code changes to ensure proper formatting
34 changes: 34 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Custom setup steps for GitHub Copilot coding agent to speed up Copilot's work on coding tasks
name: "Copilot Setup Steps"

on:
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
push:
paths:
- .github/workflows/copilot-setup-steps.yml
workflow_dispatch:

permissions:
contents: read

jobs:
copilot-setup-steps: # Job name required by GitHub Copilot coding agent
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Set up JDK for running Gradle
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: temurin
java-version: 17

- name: Set up gradle
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2

- name: Build project and download dependencies
run: ./gradlew build -x test
89 changes: 36 additions & 53 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,65 @@
# Contributing

Welcome to the OpenTelemetry Java Contrib Repository!
Welcome to the OpenTelemetry Java Contrib repository!

## Introduction

This repository focuses on providing tools and utilities for Java-based observability, such as remote JMX metric gathering and reporting. We’re excited to have you here! Whether you’re fixing a bug, adding a feature, or suggesting an idea, your contributions are invaluable.
This repository provides observability libraries and utilities for Java applications that complement
the [OpenTelemetry Java SDK](https://github.com/open-telemetry/opentelemetry-java) and
[OpenTelemetry Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation)
projects.

Before submitting new features or changes to current functionality, it is recommended to first
[open an issue](https://github.com/open-telemetry/opentelemetry-java-contrib/issues/new)
and discuss your ideas or propose the changes you wish to make.

Questions? Ask in the OpenTelemetry [java channel](https://cloud-native.slack.com/archives/C014L2KCTE3)
Before submitting new features or changes, please consider
[opening an issue](https://github.com/open-telemetry/opentelemetry-java-contrib/issues/new) first to
discuss your ideas.

Pull requests for bug fixes are always welcome!

## Pre-requisites

To work with this repository, ensure you have:

### Tools:

Java 17 or higher

### Platform Notes:
## Building and Testing

macOS/Linux: Ensure JAVA_HOME is set correctly.
While most modules target Java 8, building this project requires Java 17 or higher.

## Workflow

1. Fork the repository
2. Clone locally
3. Create a branch before working on an issue

## Local Run/Build

In order to build and test this whole repository you need JDK 11+.

#### Snapshot builds

For developers testing code changes before a release is complete, there are
snapshot builds of the `main` branch. They are available from
the Sonatype snapshot repository at `https://central.sonatype.com/repository/maven-snapshots/`
([browse](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/contrib/)).

#### Building from source

Building using Java 11+:
To build the project:

```bash
$ java -version
./gradlew assemble
```

To run the tests:

```bash
$ ./gradlew assemble
./gradlew test
```

## Testing
Some modules include integration tests that can be run with:

```bash
$ ./gradlew test
./gradlew integrationTest
```

### Some modules have integration tests
## Snapshot Builds

```
$ ./gradlew integrationTest
```
Snapshot builds of the `main` branch are available from the Sonatype snapshot repository at:
`https://central.sonatype.com/repository/maven-snapshots/`
([browse](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/contrib/)).

## Style Guide

See [Style Guide](docs/style-guide.md).

Follow the Java Instrumentation [Style Guide](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/style-guideline.md) from the opentelemetry-java-instrumentation repository.
## Pull Request Guidelines

Failure? Check logs for errors or mismatched dependencies.
When submitting a pull request, please ensure that you:

## Gradle conventions
- Clearly describe the change and its motivation
- Mention any breaking changes
- Include tests for new functionality
- Follow the [Style Guide](docs/style-guide.md)

- Use kotlin instead of groovy
- Plugin versions should be specified in `settings.gradle.kts`, not in individual modules
- All modules use `plugins { id("otel.java-conventions") }`
## Getting Help

## Further Help
If you need assistance or have questions:

Join [#otel-java](https://cloud-native.slack.com/archives/C014L2KCTE3) on OpenTelemetry Slack
- Post on the [#otel-java](https://cloud-native.slack.com/archives/C014L2KCTE3) Slack channel
- [Open an issue](https://github.com/open-telemetry/opentelemetry-java-contrib/issues/new/choose) in
this repository
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,9 @@ On reaching stable status, the `otel.stable` value in `gradle.properties` should
Note that currently all the libraries are released together with the version of this repo, so breaking changes (after stable
status is reached) would bump the major version of all libraries together. This could get complicated so `stable` has a high bar.

## Getting Started

```bash
# Apply formatting
$ ./gradlew spotlessApply

# Build the complete project
$ ./gradlew build

# Run integration tests
$ ./gradlew integrationTest

# Clean artifacts
$ ./gradlew clean
```

## Contributing

The Java Contrib project was initially formed to provide methods of easy remote JMX metric gathering and reporting,
which is actively in development. If you have an idea for a similar use case in the metrics, traces, or logging
domain we would be very interested in supporting it. Please
[open an issue](https://github.com/open-telemetry/opentelemetry-java-contrib/issues/new/choose) to share your idea or
suggestion. PRs are always welcome and greatly appreciated, but for larger functional changes a pre-coding introduction
can be helpful to ensure this is the correct place and that active or conflicting efforts don't exist.
See [CONTRIBUTING.md](CONTRIBUTING.md).

### Maintainers

Expand Down
4 changes: 4 additions & 0 deletions aws-resources/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ description = "OpenTelemetry AWS Resources Support"
otelJava.moduleName.set("io.opentelemetry.contrib.aws.resource")

dependencies {
annotationProcessor("com.google.auto.service:auto-service")
compileOnly("com.google.auto.service:auto-service")

api("io.opentelemetry:opentelemetry-api")
compileOnly("io.opentelemetry:opentelemetry-api-incubator")
api("io.opentelemetry:opentelemetry-sdk")
Expand All @@ -23,6 +26,7 @@ dependencies {
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
testImplementation("io.opentelemetry:opentelemetry-api-incubator")
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
testImplementation("com.google.auto.service:auto-service")

testImplementation("com.linecorp.armeria:armeria-junit5")
testRuntimeOnly("org.bouncycastle:bcpkix-jdk15on")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static io.opentelemetry.contrib.aws.resource.IncubatingAttributes.SERVICE_INSTANCE_ID;
import static io.opentelemetry.contrib.aws.resource.IncubatingAttributes.SERVICE_NAMESPACE;
import static io.opentelemetry.semconv.ServiceAttributes.SERVICE_VERSION;
import static java.util.logging.Level.WARNING;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
Expand All @@ -22,7 +23,6 @@
import io.opentelemetry.semconv.SchemaUrls;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
Expand Down Expand Up @@ -65,7 +65,7 @@ static Resource buildResource(String configPath) {
parser.nextToken();

if (!parser.isExpectedStartObjectToken()) {
logger.log(Level.WARNING, "Invalid Beanstalk config: ", configPath);
logger.log(WARNING, "Invalid Beanstalk config: ", configPath);
return Resource.create(attrBuilders.build(), SchemaUrls.V1_25_0);
}

Expand All @@ -87,7 +87,7 @@ static Resource buildResource(String configPath) {
}
}
} catch (IOException e) {
logger.log(Level.WARNING, "Could not parse Beanstalk config.", e);
logger.log(WARNING, "Could not parse Beanstalk config.", e);
return Resource.empty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

package io.opentelemetry.contrib.aws.resource;

import com.google.auto.service.AutoService;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
import io.opentelemetry.sdk.resources.Resource;

/** {@link ResourceProvider} for automatically configuring {@link BeanstalkResource}. */
@AutoService(ResourceProvider.class)
public final class BeanstalkResourceProvider extends CloudResourceProvider {
@Override
public Resource createResource(ConfigProperties config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

package io.opentelemetry.contrib.aws.resource;

import static java.util.logging.Level.WARNING;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

class DockerHelper {
Expand Down Expand Up @@ -44,9 +45,9 @@ public String getContainerId() {
}
}
} catch (FileNotFoundException e) {
logger.log(Level.WARNING, "Failed to read container id, cgroup file does not exist.");
logger.log(WARNING, "Failed to read container id, cgroup file does not exist.");
} catch (IOException e) {
logger.log(Level.WARNING, "Unable to read container id: " + e.getMessage());
logger.log(WARNING, "Unable to read container id: " + e.getMessage());
}

return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import static io.opentelemetry.contrib.aws.resource.IncubatingAttributes.HOST_IMAGE_ID;
import static io.opentelemetry.contrib.aws.resource.IncubatingAttributes.HOST_NAME;
import static io.opentelemetry.contrib.aws.resource.IncubatingAttributes.HOST_TYPE;
import static java.util.logging.Level.WARNING;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
Expand All @@ -28,7 +29,6 @@
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
Expand Down Expand Up @@ -125,7 +125,7 @@ static Resource buildResource(String endpoint) {
}
}
} catch (IOException e) {
logger.log(Level.WARNING, "Could not parse identity document, resource not filled.", e);
logger.log(WARNING, "Could not parse identity document, resource not filled.", e);
return Resource.empty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

package io.opentelemetry.contrib.aws.resource;

import com.google.auto.service.AutoService;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
import io.opentelemetry.sdk.resources.Resource;

/** {@link ResourceProvider} for automatically configuring {@link Ec2Resource}. */
@AutoService(ResourceProvider.class)
public final class Ec2ResourceProvider extends CloudResourceProvider {
@Override
public Resource createResource(ConfigProperties config) {
Expand Down
Loading
Loading