Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial project structure #2

Merged
merged 4 commits into from
Aug 20, 2020
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
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto eol=lf

*.bat text eol=crlf
*.cmd text eol=crlf
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Description**
A clear and concise description of what the bug is or observed behavior.

**Steps to reproduce**
Provide a (runnable) recipe for reproducing the error.

**Expectation**
A clear and concise description of what you expected to see.

**What applicable config did you use?**
Config: (e.g. the yaml config file)

**Relevant Environment Information**
Version: (e.g., `v0.0.1`, `2bef20a`, etc.)
OS: (e.g., "Ubuntu 20.04")
Compiler (if manually compiled): (e.g., "openJDK 1.8.0_252")

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Description:**

< Describe what is being changed or added.
Ex. Bug fix - Describe the bug and how this fixes it.
Ex. Feature addition - Describe what this provides and why. >

**Existing Issue(s):**

< Link any applicable issues. >

**Testing:**

< Describe what testing was performed and any tests were added. >

**Documentation:**

< Describe the documentation added.
Please be sure to modify relevant existing documentation if needed. >

**Outstanding items:**

< Anything that these changes are intentionally missing
that will be needed or can be helpful in the future. >
45 changes: 36 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,41 @@
# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# IntelliJ
*.idea
*.iml

# Gradle
build
.gradle
local.properties
out/

# Maven (proto)
target

# Eclipse
.classpath
.project
.settings
bin

# NetBeans
/.nb-gradle
/.nb-gradle-properties

# VS Code
.vscode

# etc
.DS_Store

# Emacs
*~
\#*\#

# Vim
.swp
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.DEFAULT_GOAL := build

.PHONY: build
build:
./gradlew build

.PHONY: lint
lint:
./gradlew spotlessApply

.PHONY: check
check:
./gradlew spotlessCheck

.PHONY: clean
clean:
./gradlew clean
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# OpenTelemetry Java Contrib

This project is intended to provide helpful libraries and standalone OpenTelemetry-based utilities that don't fit
the express scope of the [OpenTelemetry Java](https://github.com/open-telemetry/opentelemetry-java) or
[Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation) projects. If you need an
easier way to bring observability to remote JVM-based applications and workflows that isn't easily satisfied by an SDK
feature or via instrumentation, this project is hopefully for you.

*This project is in its early stages and doesn't provide any assurances of stability or production readiness.*

## Getting Started

```bash
# Build the complete project
$ make build

# Clean artifacts
$ make clean

# Apply formatting
$ make lint
```

## 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.

## Owners

- [Anuraag Agrawal](https://github.com/anuraaga), AWS
- [Pablo Collins](https://github.com/pmcollins), Splunk
- [Ryan Fitzpatrick](https://github.com/rmfitzpatrick), Splunk (maintainer)
- [Trask Stalnaker](https://github.com/trask), Microsoft

For more information on the OpenTelemetry community please see the
[community content project](https://github.com/open-telemetry/community).
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id 'com.diffplug.spotless' version '5.1.1'
}

description = 'OpenTelemetry Contrib libraries and utilities for the JVM'

allprojects {
group = 'io.opentelemetry.contrib'
version = '0.0.1'

apply from: "$rootDir/gradle/spotless.gradle"
apply from: "$rootDir/gradle/dependencies.gradle"

it.ext.contrib = "$rootDir/gradle/contrib.gradle"

repositories {
mavenLocal()
jcenter()
mavenCentral()
}
}
3 changes: 3 additions & 0 deletions contrib/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example Library

This is an example library intended to be used as a template for easy additions to the OpenTelemetry Java Contrib project.
9 changes: 9 additions & 0 deletions contrib/example/example.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apply from: project.contrib

description = 'An example OpenTelemetry Java Contrib library'

jar {
manifest {
attributes('Main-Class': 'io.opentelemetry.contrib.example.Library')
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright The OpenTelemetry Authors
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.opentelemetry.contrib.example;

public class Library {

public boolean myMethod() {
return true;
}

public static void main(String... args) {
System.out.println("ExampleLibrary.main");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright The OpenTelemetry Authors
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.opentelemetry.contrib.example

import spock.lang.Specification

class LibraryTest extends Specification {

def 'testSomeLibraryMethod'() {
when: 'we create Library instance'
def classUnderTest = new Library()

then: 'it provides its method'
classUnderTest.myMethod() == true
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.gradle.daemon=false
org.gradle.parallel=true
22 changes: 22 additions & 0 deletions gradle/contrib.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apply plugin: 'java'
apply plugin: 'groovy'

ext.releaseJavaVersion = JavaVersion.VERSION_1_7
ext.testJavaVersion = JavaVersion.VERSION_1_8

java {
archivesBaseName = "${rootProject.name}-${project.name}"
sourceCompatibility = project.releaseJavaVersion
targetCompatibility = project.releaseJavaVersion
withJavadocJar()
withSourcesJar()
}

compileTestJava {
sourceCompatibility = project.testJavaVersion
targetCompatibility = project.testJavaVersion
}

dependencies {
testImplementation project.libraries.spock
}
23 changes: 23 additions & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ext {
versions = [
otelStable : '0.7.1'
]

libraries = [
// otel
otelApi : "io.opentelemetry:opentelemetry-api:${versions.otelStable}",
otelSdk : "io.opentelemetry:opentelemetry-sdk:${versions.otelStable}",
otelExporterInMemory : "io.opentelemetry:opentelemetry-exporters-inmemory:${versions.otelStable}",
otelExporterJaeger : "io.opentelemetry:opentelemetry-exporters-jaeger:${versions.otelStable}",
otelExporterLogging : "io.opentelemetry:opentelemetry-exporters-logging:${versions.otelStable}",
otelExporterOtlp : "io.opentelemetry:opentelemetry-exporters-otlp:${versions.otelStable}",
otelExporterPrometheus : "io.opentelemetry:opentelemetry-exporters-prometheus:${versions.otelStable}",
otelExporterZipkin : "io.opentelemetry:opentelemetry-exporters-zipkin:${versions.otelStable}",
otelProto : "io.opentelemetry:opentelemetry-proto:${versions.otelStable}",

// testing
spock : dependencies.create('org.spockframework:spock-core:1.3-groovy-2.5', {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
})
]
}
16 changes: 16 additions & 0 deletions gradle/java.license.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright The OpenTelemetry Authors
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/

30 changes: 30 additions & 0 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apply plugin: 'com.diffplug.spotless'
apply plugin: 'groovy'

spotless {
format 'misc', {
target '**/*.md', '.gitignore'
indentWithSpaces()
trimTrailingWhitespace()
endWithNewline()
}
java {
target '**/src/*/java/**/*.java'
googleJavaFormat()
indentWithSpaces()
licenseHeaderFile rootProject.file('gradle/java.license.header'), '(package|import|public)'
}
groovy {
target '**/*.groovy'
greclipse()
indentWithSpaces()
licenseHeaderFile rootProject.file('gradle/java.license.header'), '(package|import|class)'
}
groovyGradle {
target '**/*.gradle'
greclipse()
indentWithSpaces()
}
}

check.dependsOn 'spotlessCheck'
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading