Skip to content

Commit c40c4da

Browse files
Initial project structure (#2)
* Initial gradle project * Github templates * set default and cmd line endings * Correct readme's instrumentation description
1 parent 2bef20a commit c40c4da

22 files changed

+640
-9
lines changed

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto eol=lf
2+
3+
*.bat text eol=crlf
4+
*.cmd text eol=crlf

.github/ISSUE_TEMPLATE/bug_report.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Description**
11+
A clear and concise description of what the bug is or observed behavior.
12+
13+
**Steps to reproduce**
14+
Provide a (runnable) recipe for reproducing the error.
15+
16+
**Expectation**
17+
A clear and concise description of what you expected to see.
18+
19+
**What applicable config did you use?**
20+
Config: (e.g. the yaml config file)
21+
22+
**Relevant Environment Information**
23+
Version: (e.g., `v0.0.1`, `2bef20a`, etc.)
24+
OS: (e.g., "Ubuntu 20.04")
25+
Compiler (if manually compiled): (e.g., "openJDK 1.8.0_252")
26+
27+
**Additional context**
28+
Add any other context about the problem here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Description:**
2+
3+
< Describe what is being changed or added.
4+
Ex. Bug fix - Describe the bug and how this fixes it.
5+
Ex. Feature addition - Describe what this provides and why. >
6+
7+
**Existing Issue(s):**
8+
9+
< Link any applicable issues. >
10+
11+
**Testing:**
12+
13+
< Describe what testing was performed and any tests were added. >
14+
15+
**Documentation:**
16+
17+
< Describe the documentation added.
18+
Please be sure to modify relevant existing documentation if needed. >
19+
20+
**Outstanding items:**
21+
22+
< Anything that these changes are intentionally missing
23+
that will be needed or can be helpful in the future. >

.gitignore

+36-9
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,41 @@
1010
# Mobile Tools for Java (J2ME)
1111
.mtj.tmp/
1212

13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
2213
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2314
hs_err_pid*
15+
16+
# IntelliJ
17+
*.idea
18+
*.iml
19+
20+
# Gradle
21+
build
22+
.gradle
23+
local.properties
24+
out/
25+
26+
# Maven (proto)
27+
target
28+
29+
# Eclipse
30+
.classpath
31+
.project
32+
.settings
33+
bin
34+
35+
# NetBeans
36+
/.nb-gradle
37+
/.nb-gradle-properties
38+
39+
# VS Code
40+
.vscode
41+
42+
# etc
43+
.DS_Store
44+
45+
# Emacs
46+
*~
47+
\#*\#
48+
49+
# Vim
50+
.swp

Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.DEFAULT_GOAL := build
2+
3+
.PHONY: build
4+
build:
5+
./gradlew build
6+
7+
.PHONY: lint
8+
lint:
9+
./gradlew spotlessApply
10+
11+
.PHONY: check
12+
check:
13+
./gradlew spotlessCheck
14+
15+
.PHONY: clean
16+
clean:
17+
./gradlew clean

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# OpenTelemetry Java Contrib
2+
3+
This project is intended to provide helpful libraries and standalone OpenTelemetry-based utilities that don't fit
4+
the express scope of the [OpenTelemetry Java](https://github.com/open-telemetry/opentelemetry-java) or
5+
[Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation) projects. If you need an
6+
easier way to bring observability to remote JVM-based applications and workflows that isn't easily satisfied by an SDK
7+
feature or via instrumentation, this project is hopefully for you.
8+
9+
*This project is in its early stages and doesn't provide any assurances of stability or production readiness.*
10+
11+
## Getting Started
12+
13+
```bash
14+
# Build the complete project
15+
$ make build
16+
17+
# Clean artifacts
18+
$ make clean
19+
20+
# Apply formatting
21+
$ make lint
22+
```
23+
24+
## Contributing
25+
26+
The Java Contrib project was initially formed to provide methods of easy remote JMX metric gathering and reporting,
27+
which is actively in development. If you have an idea for a similar use case in the metrics, traces, or logging
28+
domain we would be very interested in supporting it. Please
29+
[open an issue](https://github.com/open-telemetry/opentelemetry-java-contrib/issues/new/choose) to share your idea or
30+
suggestion. PRs are always welcome and greatly appreciated, but for larger functional changes a pre-coding introduction
31+
can be helpful to ensure this is the correct place and that active or conflicting efforts don't exist.
32+
33+
## Owners
34+
35+
- [Anuraag Agrawal](https://github.com/anuraaga), AWS
36+
- [Pablo Collins](https://github.com/pmcollins), Splunk
37+
- [Ryan Fitzpatrick](https://github.com/rmfitzpatrick), Splunk (maintainer)
38+
- [Trask Stalnaker](https://github.com/trask), Microsoft
39+
40+
For more information on the OpenTelemetry community please see the
41+
[community content project](https://github.com/open-telemetry/community).

build.gradle

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
id 'com.diffplug.spotless' version '5.1.1'
3+
}
4+
5+
description = 'OpenTelemetry Contrib libraries and utilities for the JVM'
6+
7+
allprojects {
8+
group = 'io.opentelemetry.contrib'
9+
version = '0.0.1'
10+
11+
apply from: "$rootDir/gradle/spotless.gradle"
12+
apply from: "$rootDir/gradle/dependencies.gradle"
13+
14+
it.ext.contrib = "$rootDir/gradle/contrib.gradle"
15+
16+
repositories {
17+
mavenLocal()
18+
jcenter()
19+
mavenCentral()
20+
}
21+
}

contrib/example/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Example Library
2+
3+
This is an example library intended to be used as a template for easy additions to the OpenTelemetry Java Contrib project.

contrib/example/example.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apply from: project.contrib
2+
3+
description = 'An example OpenTelemetry Java Contrib library'
4+
5+
jar {
6+
manifest {
7+
attributes('Main-Class': 'io.opentelemetry.contrib.example.Library')
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.opentelemetry.contrib.example;
18+
19+
public class Library {
20+
21+
public boolean myMethod() {
22+
return true;
23+
}
24+
25+
public static void main(String... args) {
26+
System.out.println("ExampleLibrary.main");
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.opentelemetry.contrib.example
18+
19+
import spock.lang.Specification
20+
21+
class LibraryTest extends Specification {
22+
23+
def 'testSomeLibraryMethod'() {
24+
when: 'we create Library instance'
25+
def classUnderTest = new Library()
26+
27+
then: 'it provides its method'
28+
classUnderTest.myMethod() == true
29+
}
30+
}

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.gradle.daemon=false
2+
org.gradle.parallel=true

gradle/contrib.gradle

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apply plugin: 'java'
2+
apply plugin: 'groovy'
3+
4+
ext.releaseJavaVersion = JavaVersion.VERSION_1_7
5+
ext.testJavaVersion = JavaVersion.VERSION_1_8
6+
7+
java {
8+
archivesBaseName = "${rootProject.name}-${project.name}"
9+
sourceCompatibility = project.releaseJavaVersion
10+
targetCompatibility = project.releaseJavaVersion
11+
withJavadocJar()
12+
withSourcesJar()
13+
}
14+
15+
compileTestJava {
16+
sourceCompatibility = project.testJavaVersion
17+
targetCompatibility = project.testJavaVersion
18+
}
19+
20+
dependencies {
21+
testImplementation project.libraries.spock
22+
}

gradle/dependencies.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ext {
2+
versions = [
3+
otelStable : '0.7.1'
4+
]
5+
6+
libraries = [
7+
// otel
8+
otelApi : "io.opentelemetry:opentelemetry-api:${versions.otelStable}",
9+
otelSdk : "io.opentelemetry:opentelemetry-sdk:${versions.otelStable}",
10+
otelExporterInMemory : "io.opentelemetry:opentelemetry-exporters-inmemory:${versions.otelStable}",
11+
otelExporterJaeger : "io.opentelemetry:opentelemetry-exporters-jaeger:${versions.otelStable}",
12+
otelExporterLogging : "io.opentelemetry:opentelemetry-exporters-logging:${versions.otelStable}",
13+
otelExporterOtlp : "io.opentelemetry:opentelemetry-exporters-otlp:${versions.otelStable}",
14+
otelExporterPrometheus : "io.opentelemetry:opentelemetry-exporters-prometheus:${versions.otelStable}",
15+
otelExporterZipkin : "io.opentelemetry:opentelemetry-exporters-zipkin:${versions.otelStable}",
16+
otelProto : "io.opentelemetry:opentelemetry-proto:${versions.otelStable}",
17+
18+
// testing
19+
spock : dependencies.create('org.spockframework:spock-core:1.3-groovy-2.5', {
20+
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
21+
})
22+
]
23+
}

gradle/java.license.header

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+

gradle/spotless.gradle

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apply plugin: 'com.diffplug.spotless'
2+
apply plugin: 'groovy'
3+
4+
spotless {
5+
format 'misc', {
6+
target '**/*.md', '.gitignore'
7+
indentWithSpaces()
8+
trimTrailingWhitespace()
9+
endWithNewline()
10+
}
11+
java {
12+
target '**/src/*/java/**/*.java'
13+
googleJavaFormat()
14+
indentWithSpaces()
15+
licenseHeaderFile rootProject.file('gradle/java.license.header'), '(package|import|public)'
16+
}
17+
groovy {
18+
target '**/*.groovy'
19+
greclipse()
20+
indentWithSpaces()
21+
licenseHeaderFile rootProject.file('gradle/java.license.header'), '(package|import|class)'
22+
}
23+
groovyGradle {
24+
target '**/*.gradle'
25+
greclipse()
26+
indentWithSpaces()
27+
}
28+
}
29+
30+
check.dependsOn 'spotlessCheck'

gradle/wrapper/gradle-wrapper.jar

57.8 KB
Binary file not shown.
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)