Skip to content

Commit c82fddc

Browse files
authored
Merge pull request open-telemetry#2 from hdost/add-original-code
Add Code From open-telemetry/opentelemetry-rust
2 parents 22e0e11 + e60c227 commit c82fddc

File tree

131 files changed

+18220
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+18220
-7
lines changed

.cspell.json

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
// http://cspell.org/configuration/
2+
{
3+
"version": "0.2",
4+
"language": "en,en-US",
5+
"useGitignore": true,
6+
"minWordLength": 4,
7+
"ignorePaths": [
8+
"target/**"
9+
],
10+
// list of words to be ignored. unlike `words` below, these won't be
11+
// suggested as corrections for misspelled words.
12+
"ignoreWords": [
13+
"otel",
14+
"rustdoc",
15+
"rustfilt"
16+
],
17+
// these are words that are always considered incorrect.
18+
"flagWords": [
19+
"recieve",
20+
"reciever",
21+
"seperate",
22+
"hte",
23+
"teh"
24+
],
25+
// these are words that are always correct and can be thought of as our
26+
// workspace dictionary.
27+
"words": [
28+
"actix",
29+
"appender",
30+
"appenders",
31+
"Bhasin",
32+
"Cijo",
33+
"codecov",
34+
"deque",
35+
"Dirkjan",
36+
"hasher",
37+
"isahc",
38+
"Isobel",
39+
"jaegertracing",
40+
"Kühle",
41+
"Kumar",
42+
"Lalit",
43+
"msrv",
44+
"Ochtman",
45+
"openetelemetry",
46+
"opentelemetry",
47+
"OTLP",
48+
"protoc",
49+
"quantile",
50+
"Redelmeier",
51+
"reqwest",
52+
"rustc",
53+
"Tescher",
54+
"Zhongyang",
55+
"zipkin"
56+
],
57+
"enabledLanguageIds": [
58+
"jsonc",
59+
"markdown",
60+
"plaintext",
61+
"rust",
62+
"shellscript"
63+
],
64+
"languageSettings": [
65+
{
66+
"languageId": "jsonc",
67+
"includeRegExpList": [
68+
"CStyleComment"
69+
]
70+
},
71+
{
72+
"languageId": "markdown",
73+
"caseSensitive": false
74+
},
75+
{
76+
"languageId": "rust",
77+
"includeRegExpList": [
78+
"CStyleComment",
79+
"strings"
80+
]
81+
},
82+
{
83+
"languageId": "shellscript",
84+
"includeRegExpList": [
85+
"/#.*/g"
86+
]
87+
}
88+
]
89+
}

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target/

.github/ISSUE_TEMPLATE/BUG-REPORT.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: "[Bug]: "
4+
labels: ["bug", "triage:todo"]
5+
projects: ["open-telemetry/opentelemetry-rust-contrib"]
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for taking the time to fill out this bug report!
11+
- type: textarea
12+
id: what-happened
13+
attributes:
14+
label: What happened?
15+
description: Also tell us, what did you expect to happen?
16+
placeholder: Tell us what you see!
17+
value: "A bug happened!"
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: api-version
22+
attributes:
23+
label: API Version
24+
description: What version of the OpenTelemetry API are you using?
25+
placeholder: 0.x, 1.x, etc.
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: sdk-version
30+
attributes:
31+
label: SDK Version
32+
description: What version of the OpenTelemetry SDK are you using?
33+
placeholder: 0.x, 1.x, etc.
34+
validations:
35+
required: true
36+
- type: dropdown
37+
id: components
38+
attributes:
39+
label: What component are you working with?
40+
multiple: true
41+
options:
42+
- opentelemetry-aws
43+
- opentelemetry-contrib
44+
- opentelemetry-datadog
45+
- opentelemetry-dynatrace
46+
- opentelemetry-stackdriver
47+
- opentelemetry-user-events-logs
48+
- opentelemetry-user-events-metrics
49+
- opentelemetry-zpages
50+
- N/A
51+
- type: textarea
52+
id: logs
53+
attributes:
54+
label: Relevant log output
55+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
56+
render: shell
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: "Feature Request"
3+
description: Request a feature for the OpenTelemetry Rust implementation.
4+
title: "[Feature]: "
5+
labels: ["enhancement", "triage:todo"]
6+
projects: ["open-telemetry/opentelemetry-rust-contrib"]
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for using our library and trying to make it better!
12+
13+
Before opening a feature request against this repo, consider whether the feature
14+
should/could be implemented in the [other OpenTelemetry client
15+
libraries](https://github.com/open-telemetry/). If so, please [open an issue on
16+
opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification/issues/new) first.
17+
- type: textarea
18+
id: related-problem
19+
attributes:
20+
label: Related Problems?
21+
description: Is your feature request related to a problem? If so, provide a concise description of the problem.
22+
placeholder: Include the Issue ID from this or other repos.
23+
validations:
24+
required: false
25+
- type: dropdown
26+
id: components
27+
attributes:
28+
label: What component are you working with?
29+
multiple: true
30+
options:
31+
- opentelemetry-aws
32+
- opentelemetry-contrib
33+
- opentelemetry-datadog
34+
- opentelemetry-dynatrace
35+
- opentelemetry-stackdriver
36+
- opentelemetry-user-events-logs
37+
- opentelemetry-user-events-metrics
38+
- opentelemetry-zpages
39+
- N/A
40+
- type: textarea
41+
id: solution
42+
attributes:
43+
label: "Describe the solution you'd like:"
44+
description: What do you want to happen instead? What is the expected behavior?
45+
placeholder: I'd like the api to ...
46+
validations:
47+
required: true
48+
- type: textarea
49+
id: alternatives
50+
attributes:
51+
label: Considered Alternatives
52+
description: Which alternative solutions or features have you considered?
53+
placeholder: Some potential solutions
54+
validations:
55+
required: false
56+
- type: textarea
57+
id: additional-context
58+
attributes:
59+
label: Additional Context
60+
description: Add any other context about the feature request here.
61+
placeholder: Some related requests in other project or upstream spec proposals.
62+
validations:
63+
required: false

.github/ISSUE_TEMPLATE/config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
contact_links:
2+
- name: GitHub Discussions
3+
url: https://github.com/open-telemetry/opentelemetry-rust-contrib/discussions/new/choose
4+
about: Please ask questions here.
5+
- name: Slack
6+
url: https://cloud-native.slack.com/archives/C03GDP0H023
7+
about: Or the `#otel-rust` channel in the CNCF Slack instance. (Not terribly responsive.)
8+
- name: "⚠️ Report a security vulnerability"
9+
url: "https://github.com/open-telemetry/opentelemetry-rust-contrib/security/advisories/new"
10+
about: "Report a security vulnerability."
11+

.github/PULL_REQUEST_TEMPLATE.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Fixes #
2+
Design discussion issue (if applicable) #
3+
4+
## Changes
5+
6+
Please provide a brief description of the changes here.
7+
8+
## Merge requirement checklist
9+
10+
* [ ] [CONTRIBUTING](https://github.com/open-telemetry/opentelemetry-rust/blob/main/CONTRIBUTING.md) guidelines followed
11+
* [ ] Unit tests added/updated (if applicable)
12+
* [ ] Appropriate `CHANGELOG.md` files updated for non-trivial, user-facing changes
13+
* [ ] Changes in public API reviewed (if applicable)

.github/codecov.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 1
6+
round: down
7+
range: "50...100"
8+
status:
9+
project:
10+
default:
11+
target: auto
12+
threshold: 0.5%
13+
14+
ignore:
15+
- "opentelemetry/src/testing" # test harnesses
16+
- "opentelemetry-jaeger/src/testing" # test harness
17+
- "opentelemetry-jaeger/src/exporter/thrift" # auto generated files
18+
- "opentelemetry-otlp/src/proto" # auto generated files
19+
- "opentelemetry-proto/src/proto" # auto generated files
20+
# examples below
21+
- "examples"
22+
- "opentelemetry-jaeger/examples"
23+
- "opentelemetry-zipkin/examples"
24+
- "opentelemetry-otlp/examples"
25+
- "opentelemetry-aws/examples"
26+
- "opentelemetry-datadog/examples"
27+
- "opentelemetry-dynatrace/examples"
28+
- "opentelemetry-http/examples"
29+
- "opentelemetry-prometheus/examples"
30+
- "opentelemetry-zpages/examples"

.github/workflows/ci.yml

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
env:
3+
CI: true
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
paths-ignore:
10+
- '**.md'
11+
jobs:
12+
test:
13+
strategy:
14+
matrix:
15+
rust: [stable, beta]
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Free disk space
19+
run: |
20+
df -h
21+
sudo rm -rf /usr/local/lib/android
22+
sudo rm -rf /usr/share/dotnet
23+
df -h
24+
- uses: actions/checkout@v1
25+
with:
26+
submodules: true
27+
- uses: actions-rs/toolchain@v1
28+
with:
29+
toolchain: ${{ matrix.rust }}
30+
components: rustfmt
31+
profile: minimal
32+
- uses: arduino/setup-protoc@v1
33+
- name: Test
34+
run: ./scripts/test.sh
35+
lint:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v1
39+
with:
40+
submodules: true
41+
- uses: actions-rs/toolchain@v1
42+
with:
43+
toolchain: stable
44+
components: rustfmt
45+
profile: minimal
46+
- uses: arduino/setup-protoc@v1
47+
- uses: actions-rs/cargo@v1
48+
with:
49+
command: fmt
50+
args: --all -- --check
51+
- name: Lint
52+
run: ./scripts/lint.sh
53+
# TODO: re-add this test
54+
# msrv:
55+
# runs-on: ubuntu-latest
56+
# steps:
57+
# - uses: actions/checkout@v1
58+
# with:
59+
# submodules: true
60+
# - uses: actions-rs/toolchain@v1
61+
# with:
62+
# profile: minimal
63+
# toolchain: 1.65.0
64+
# override: true
65+
# - name: Patch dependencies versions # some dependencies bump MSRV without major version bump
66+
# run: ./scripts/patch_dependencies.sh
67+
# - name: Run tests
68+
# run: cargo --version &&
69+
# cargo test --manifest-path=opentelemetry/Cargo.toml --features trace,metrics,testing &&
70+
# cargo test --manifest-path=opentelemetry-jaeger/Cargo.toml --features rt-tokio &&
71+
# cargo test --manifest-path=opentelemetry-zipkin/Cargo.toml
72+
cargo-deny:
73+
runs-on: ubuntu-latest
74+
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
75+
steps:
76+
- uses: actions/checkout@v2
77+
- uses: EmbarkStudios/cargo-deny-action@v1
78+
with:
79+
command: check advisories
80+
docs:
81+
continue-on-error: true
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v2
85+
- uses: actions-rs/toolchain@v1
86+
with:
87+
toolchain: nightly
88+
components: rustfmt
89+
override: true
90+
- uses: arduino/setup-protoc@v1
91+
- name: doc
92+
run: cargo doc --no-deps --all-features
93+
env:
94+
CARGO_INCREMENTAL: '0'
95+
RUSTDOCFLAGS: -Dwarnings
96+
coverage:
97+
continue-on-error: true
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v3
101+
with:
102+
submodules: true
103+
- uses: actions-rs/toolchain@v1
104+
with:
105+
toolchain: stable
106+
components: rustfmt,llvm-tools-preview
107+
override: true
108+
- uses: arduino/setup-protoc@v1
109+
- name: cargo install cargo-llvm-cov
110+
uses: taiki-e/install-action@cargo-llvm-cov
111+
- name: cargo generate-lockfile
112+
if: hashFiles('Cargo.lock') == ''
113+
run: cargo generate-lockfile
114+
- name: cargo llvm-cov
115+
run: cargo llvm-cov --locked --all-features --workspace --lcov --output-path lcov.info
116+
- name: Upload to codecov.io
117+
uses: codecov/codecov-action@v3
118+
with:
119+
fail_ci_if_error: true

0 commit comments

Comments
 (0)