Skip to content

Commit e8c3458

Browse files
authored
Merge branch 'main' into ms/add-spec-links
2 parents 4ced0ae + d586b0f commit e8c3458

35 files changed

+842
-524
lines changed

.github/workflows/fossa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
elixir-version: "1.18.1"
2222
version-type: "strict"
2323

24-
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
24+
- uses: fossas/fossa-action@c0a7d013f84c8ee5e910593186598625513cc1e4 # v1.6.0
2525
with:
2626
api-key: ${{secrets.FOSSA_API_KEY}}
2727
team: OpenTelemetry
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: OSSF Scorecard
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: "33 11 * * 1" # once a week
9+
workflow_dispatch:
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
# Needed for Code scanning upload
18+
security-events: write
19+
# Needed for GitHub OIDC token if publish_results is true
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
27+
with:
28+
results_file: results.sarif
29+
results_format: sarif
30+
publish_results: true
31+
32+
# Upload the results as artifacts (optional). Commenting out will disable
33+
# uploads of run results in SARIF format to the repository Actions tab.
34+
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
35+
- name: "Upload artifact"
36+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
37+
with:
38+
name: SARIF file
39+
path: results.sarif
40+
retention-days: 5
41+
42+
# Upload the results to GitHub's code scanning dashboard (optional).
43+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
44+
- name: "Upload to code-scanning"
45+
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
46+
with:
47+
sarif_file: results.sarif

CONTRIBUTING.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Development Setup Guide for Erlang Repository
2+
3+
## Introduction
4+
Welcome to the Erlang Repository! 🎉
5+
6+
This guide aims to assist contributors in setting up their local development environment. Feel free to suggest improvements or raise questions in your contributions.
7+
8+
## Pre-requisites
9+
10+
To work with this repository, you'll need the following tools and dependencies:
11+
12+
- **Erlang/OTP Version** :
13+
14+
- We support the latest major release plus the prior two releases, aligning with Ericsson’s version support policy for Erlang itself.
15+
- For a definitive list of supported versions, refer to the [erlang.yml](.github/workflows/erlang.yml) file in this repository.
16+
17+
If using the Elixir API:
18+
19+
* Elixir 1.14+
20+
21+
* For a definitive list of supported versions, refer to the [elixir.yml](.github/workflows/elixir.yml) file in this repository.
22+
23+
* Refer to the official [Erlang Installation Guide](https://www.erlang.org/downloads) for setting up Erlang.
24+
25+
## Local Run/Build
26+
27+
### Setting Up and Running the Project Locally
28+
29+
To run the project locally, follow these steps:
30+
31+
Start required services:
32+
33+
```
34+
docker compose up -d
35+
```
36+
37+
Set up Erlang/OTP and Rebar3 and Verify setup (Ensure you have the correct versions as specified in the prerequisites):
38+
39+
Run the compilation step to check for errors:
40+
```
41+
rebar3 compile
42+
```
43+
44+
## Testing
45+
46+
To execute tests, use the following commands:
47+
48+
### Unit Tests (EUnit):
49+
50+
```
51+
rebar3 eunit
52+
```
53+
54+
### Integration and Functional Tests (Common Test):
55+
56+
```
57+
rebar3 ct
58+
```
59+
60+
### Test results and logs can be viewed in a browser by opening:
61+
62+
```
63+
build/test/logs/index.html
64+
65+
```
66+
### Elixir Tests
67+
68+
Elixir tests are run in two places:
69+
70+
1. Inside apps/opentelemetry_api/:
71+
72+
```
73+
mix test
74+
```
75+
76+
2. At the top level:
77+
78+
```
79+
mix test --no-start test/otel_tests.exs test/otel_metric_tests.exs
80+
```
81+
82+
## Contribution Rules
83+
Please review the [OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel/) for details on coding standards, commit message formatting, and the contribution process.
84+
85+
## Troubleshooting Guide
86+
87+
### Debugging Common Failures
88+
89+
* Test Failures: Check the test logs in _build/test/logs/.
90+
91+
* Compilation Issues: Ensure correct OTP and Rebar3 versions are installed.
92+
93+
* Dialyzer Warnings: Ensure rebar3 compile completes successfully.
94+
95+
## Developer Setup and Language Servers
96+
97+
For improved development experience, consider using the following Language Server Protocols (LSPs):
98+
99+
* Erlang LSP: [Erlang Language Platform](https://whatsapp.github.io/erlang-language-platform/)
100+
101+
* Installing it removes the need for an additional type-checking step:
102+
103+
```
104+
elp eqwalize-all
105+
```
106+
107+
* Install from: [Erlang Language Platform Releases](https://github.com/WhatsApp/erlang-language-platform/releases/)
108+
109+
* Elixir LSP: [Elixir LS](https://github.com/elixir-lsp/elixir-ls)
110+
111+
## Further Help
112+
113+
* If you encounter any issues or have questions, feel free to open an issue or reach out to the maintainers.
114+
* Join our [slack](https://cloud-native.slack.com/archives/C01N75YMZCN) channel also for further help and discussions

apps/opentelemetry/src/otel_span_ets.erl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
update_name/2]).
3838

3939
%% since `span_ctx' and `span' are in the API the `span_sdk' has to be term()
40-
-eqwalizer({nowarn_function, end_span/1}).
41-
-eqwalizer({nowarn_function, end_span/2}).
4240
-eqwalizer({nowarn_function, get_ctx/1}).
4341

4442
-include_lib("opentelemetry_api/include/opentelemetry.hrl").

apps/opentelemetry_api/docs.config

Lines changed: 0 additions & 20 deletions
This file was deleted.

apps/opentelemetry_api/include/opentelemetry.hrl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242

4343
%% Holds information about the instrumentation scope specified when
4444
%% getting a Tracer from the TracerProvider.
45-
-record(instrumentation_scope, {name :: unicode:unicode_binary() | undefined | '_',
46-
version :: unicode:unicode_binary() | undefined | '_',
47-
schema_url :: uri_string:uri_string() | undefined | '_'}).
45+
-record(instrumentation_scope, {name :: unicode:unicode_binary() | undefined,
46+
version :: unicode:unicode_binary() | undefined,
47+
schema_url :: uri_string:uri_string() | undefined}).
4848

4949
-record(span_ctx, {
5050
%% 128 bit int trace id

apps/opentelemetry_api/mix.exs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,48 @@ defmodule OpenTelemetry.MixProject do
1818
only: [:dev],
1919
runtime: false},
2020
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
21-
{:covertool, ">= 0.0.0", only: :test}
21+
{:covertool, ">= 0.0.0", only: :test},
22+
{:ex_doc, "~> 0.37", only: :dev, runtime: false}
2223
],
2324
name: "OpenTelemetry API",
2425
test_coverage: [tool: :covertool],
2526
package: package(),
26-
aliases: [docs: & &1],
2727
dialyzer: [
2828
ignore_warnings: "dialyzer.ignore-warnings",
2929
remove_defaults: [:unknown],
3030
plt_add_apps: [:eqwalizer_support],
3131
list_unused_filters: true
32+
],
33+
source_url: "https://github.com/open-telemetry/opentelemetry-erlang",
34+
homepage_url: "https://github.com/open-telemetry/opentelemetry-erlang",
35+
docs: [
36+
main: "readme",
37+
source_url_pattern:
38+
"https://github.com/open-telemetry/opentelemetry-erlang/blob/main/apps/opentelemetry_api/%{path}#L%{line}",
39+
extras: ["README.md", "LICENSE"],
40+
groups_for_modules: [
41+
Context: [:otel_ctx, OpenTelemetry.Ctx],
42+
Baggage: [:otel_baggage, OpenTelemetry.Baggage],
43+
Tracer: [
44+
:otel_tracer,
45+
:otel_tracer_noop,
46+
:otel_tracer_provider,
47+
:otel_tracestate,
48+
OpenTelemetry.Tracer,
49+
OpenTelemetry.Span
50+
],
51+
Propagators: [
52+
:otel_propagator,
53+
:otel_propagator_baggage,
54+
:otel_propagator_b3,
55+
:otel_propagator_b3multi,
56+
:otel_propagator_b3single,
57+
:otel_propagator_text_map,
58+
:otel_propagator_text_map_composite,
59+
:otel_propagator_text_map_noop,
60+
:otel_propagator_trace_context
61+
]
62+
]
3263
]
3364
]
3465
end

apps/opentelemetry_api/mix.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
%{
22
"covertool": {:hex, :covertool, "2.0.6", "4a291b4e3449025b0595d8f44c8d7635d4f48f033be2ce88d22a329f36f94a91", [:rebar3], [], "hexpm", "5db3fcd82180d8ea4ad857d4d1ab21a8d31b5aee0d60d2f6c0f9e25a411d1e21"},
33
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
4+
"earmark_parser": {:hex, :earmark_parser, "1.4.43", "34b2f401fe473080e39ff2b90feb8ddfeef7639f8ee0bbf71bb41911831d77c5", [:mix], [], "hexpm", "970a3cd19503f5e8e527a190662be2cee5d98eed1ff72ed9b3d1a3d466692de8"},
45
"eqwalizer_support": {:git, "https://github.com/whatsapp/eqwalizer.git", "1a787cb604f6083ebe8763e358ea362e4677e500", [branch: "main", sparse: "eqwalizer_support"]},
56
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
7+
"ex_doc": {:hex, :ex_doc, "0.37.1", "65ca30d242082b95aa852b3b73c9d9914279fff56db5dc7b3859be5504417980", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "6774f75477733ea88ce861476db031f9399c110640752ca2b400dbbb50491224"},
8+
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
9+
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
10+
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
11+
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
612
}

apps/opentelemetry_api/rebar.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
{doclet, edoc_doclet_chunks},
88
{layout, edoc_layout_chunks},
99
{preprocess, true},
10-
{dir, "apps/opentelemetry_api/_build/dev/lib/opentelemetry_api/doc"},
10+
{dir, "_build/dev/lib/opentelemetry_api/doc"},
1111
{subpackages, true}]}]}]}.

apps/opentelemetry_api/src/opentelemetry.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ link(_, _) ->
394394
TraceId :: trace_id(),
395395
SpanId :: span_id(),
396396
Attributes :: attributes_map(),
397-
TraceState :: otel_tracestate:t() | otel_tracestate:members().
397+
TraceState :: otel_tracestate:t().
398398
link(TraceId, SpanId, Attributes, TraceState) when is_integer(TraceId),
399399
is_integer(SpanId),
400400
(is_list(Attributes) orelse is_map(Attributes)) ->

0 commit comments

Comments
 (0)