Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
chore: mark otlp exporters experimental
  • Loading branch information
dyladan committed Sep 27, 2021
commit 565b2786df26c27135f4d89d1b5b753c8dfc6b5e
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "packages/opentelemetry-exporter-otlp-grpc/protos"]
path = packages/opentelemetry-exporter-otlp-grpc/protos
[submodule "experimental/packages/opentelemetry-exporter-otlp-grpc/protos"]
path = experimental/packages/opentelemetry-exporter-otlp-grpc/protos
url = https://github.com/open-telemetry/opentelemetry-proto.git
[submodule "packages/opentelemetry-exporter-otlp-proto/protos"]
path = packages/opentelemetry-exporter-otlp-proto/protos
[submodule "experimental/packages/opentelemetry-exporter-otlp-proto/protos"]
path = experimental/packages/opentelemetry-exporter-otlp-proto/protos
url = https://github.com/open-telemetry/opentelemetry-proto.git
4 changes: 2 additions & 2 deletions examples/otlp-exporter-node/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Overview

This example shows how to use [@opentelemetry/exporter-otlp-http](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-otlp-http) to instrument a simple Node.js application.
This example shows how to use [@opentelemetry/exporter-otlp-http](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-otlp-http) to instrument a simple Node.js application.

This example will export spans data simultaneously using [Exporter Collector](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-otlp-http) and grpc. It will use [proto format](https://github.com/open-telemetry/opentelemetry-proto).
This example will export spans data simultaneously using [Exporter Collector](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-otlp-http) and grpc. It will use [proto format](https://github.com/open-telemetry/opentelemetry-proto).

## Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
"commonjs": true,
"node": true,
},
...require('../../eslint.config.js')
...require('../../../eslint.config.js')
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"submodule": "git submodule sync --recursive && git submodule update --init --recursive",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"version": "node ../../scripts/version-update.js",
"version": "node ../../../scripts/version-update.js",
"watch": "npm run protos:copy && tsc -w",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "npm run precompile"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# IntelliJ IDEA
.idea
*.iml

# VS Code
.vscode
.classpath
.project
.settings/

# OS X
.DS_Store

# Emacs
*~
\#*\#

# Vim
.swp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo: required
dist: xenial
language: go

script:
- make ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## Unreleased

## 0.3.0 - 2020-03-23

- Initial protos for trace, metrics, resource and OTLP.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#####################################################
#
# List of approvers for OpenTelemetry Proto repository
#
#####################################################
#
# Learn about membership in OpenTelemetry community:
# https://github.com/open-telemetry/community/blob/master/community-membership.md
#
#
# Learn about CODEOWNERS file format:
# https://help.github.com/en/articles/about-code-owners
#

# Global owners, will be the owners for everything in the repo. Membership is tracked via https://github.com/open-telemetry/community/blob/master/community-members.md
* @open-telemetry/specs-approvers

# Trace owners (global + trace)
opentelemetry/proto/trace/ @open-telemetry/specs-approvers @open-telemetry/specs-trace-approvers

# Metrics owners (global + metrics)
opentelemetry/proto/metrics/ @open-telemetry/specs-approvers @open-telemetry/specs-metrics-approvers

# Logs owners (global + logs)
opentelemetry/proto/logs/ @open-telemetry/specs-approvers @open-telemetry/specs-logs-approvers
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing

Read OpenTelemetry project [contributing
guide](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md)
for general information about the project.

## Prerequisites

- Protocol Buffers compiler `protoc`.
- Protocol Buffers Go compiler `protoc-gen-go`.

Install manually or use:

- `install-proto.sh` (if on Linux).
- Requires: `bash`, `wget`, `unzip`, `go`, and `sudo`.
- The default install directory is `/usr/local` for all downloaded binaries and libraries.
This location can be overridden by passing an alternate location to the script.
For example installing artifacts in `/opt`:
```
./install-proto.sh /opt
```
- `install-proto-osx.sh` (for mac).

## Making changes to the .proto files

Non-backward compatible changes to .proto files are permitted until protocol schema is
declared complete.

After making any changes to .proto files make sure to generate Go implementation by
running `make gen-go`. Generated files must be included in the same commit as the .proto
files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Language Independent Interface Types For OpenTelemetry

The proto files can be consumed as GIT submodule or copied over and built directly in the consumer project.

The compiled files are published to central repositories (Maven, NPM...) from OpenTelemetry client libraries.

See [contribution guidelines](CONTRIBUTING.md) if you would like to make any changes.

## Maturity Level

Component | Maturity |
-------------------------------------|----------|
**Binary Protobuf Encoding** | |
collector/metrics/* | Alpha |
collector/trace/* | Stable |
common/* | Stable |
metrics/* | Alpha |
resource/* | Stable |
trace/trace.proto | Stable |
trace/trace_config.proto | Alpha |
**JSON encoding** | |
All messages | Alpha |

(See [maturity-matrix.yaml](https://github.com/open-telemetry/community/blob/47813530864b9fe5a5146f466a58bd2bb94edc72/maturity-matrix.yaml#L57)
for definition of maturity levels).

Note that maturity guarantees apply only to wire-level compatibility for the binary
Protobuf serialization. Neither message, field, nor enum names of Protobuf messages
are visible on the wire and are not considered part of the guarantees. We are free
to make change to the names.

In the future when OTLP/JSON is declared stable, field names will also become part of
the maturity guarantees, since field names are visible on the wire for JSON encoding.

## Experiments

In some cases we are trying to experiment with different features. In this case
we recommend using an "experimental" sub-directory instead of adding them to any
protocol version. These protocols should not be used, except for
development/testing purposes.

Another review must be conducted for experimental protocols to join the main project.
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# How to Create a Release of OpenTelemetry Proto (for Maintainers Only)

## Tagging the Release

Our release branches follow the naming convention of `v<major>.<minor>.x`, while
the tags include the patch version `v<major>.<minor>.<patch>`. For example, the
same branch `v0.3.x` would be used to create all `v0.3` tags (e.g. `v0.3.0`,
`v0.3.1`).

In this section upstream repository refers to the main opentelemetry-proto
github repository.

Before any push to the upstream repository you need to create a [personal access
token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/).

1. Create the release branch and push it to GitHub:

```bash
MAJOR=0 MINOR=3 PATCH=0 # Set appropriately for new release
git checkout -b v$MAJOR.$MINOR.x master
git push upstream v$MAJOR.$MINOR.x
```

2. Enable branch protection for the new branch, if you have admin access.
Otherwise, let someone with admin access know that there is a new release
branch.

- Open the branch protection settings for the new branch, by following
[Github's instructions](https://help.github.com/articles/configuring-protected-branches/).
- Copy the settings from a previous branch, i.e., check
- `Protect this branch`
- `Require pull request reviews before merging`
- `Require status checks to pass before merging`
- `Include administrators`

Enable the following required status checks:
- `cla/linuxfoundation`
- `ci/circleci: build`
- Uncheck everything else.
- Click "Save changes".

3. For `vMajor.Minor.x` branch:

- Create and push a tag:

```bash
git checkout v$MAJOR.$MINOR.x
git pull upstream v$MAJOR.$MINOR.x
git tag -a v$MAJOR.$MINOR.$PATCH -m "Version $MAJOR.$MINOR.$PATCH"
git push upstream v$MAJOR.$MINOR.$PATCH
```

## Patch Release

All patch releases should include only bug-fixes, and must avoid
adding/modifying the public APIs. To cherry-pick one commit use the following
instructions:

- Create and push a tag:

```bash
COMMIT=1224f0a # Set the right commit hash.
git checkout -b cherrypick v$MAJOR.$MINOR.x
git cherry-pick -x $COMMIT
git commit -a -m "Cherry-pick commit $COMMIT"
```

- Go through PR review and merge it to GitHub v$MAJOR.$MINOR.x branch.

- Tag a new patch release when all commits are merged.

## Announcement

Once deployment is done, go to Github [release
page](https://github.com/open-telemetry/opentelemetry-proto/releases), press
`Draft a new release` to write release notes about the new release.

You can use `git log upstream/v$MAJOR.$((MINOR-1)).x..upstream/v$MAJOR.$MINOR.x --graph --first-parent`
or the Github [compare tool](https://github.com/open-telemetry/opentelemetry-proto/compare/)
to view a summary of all commits since last release as a reference.

In addition, you can refer to
[CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-proto/blob/master/CHANGELOG.md)
for a list of major changes since last release.

## Update release versions in documentations and CHANGELOG files

After releasing is done, you need to update
[README.md](https://github.com/open-telemetry/opentelemetry-proto/blob/master/README.md) and
[CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-proto/blob/master/CHANGELOG.md).

Create a PR to mark the new release in
[CHANGELOG.md](https://github.com/census-instrumentation/opencensus-java/blob/master/CHANGELOG.md)
on master branch.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
GOPATH_DIR := $(GOPATH)/src/github.com/open-telemetry/opentelemetry-proto
GENDIR := gen
GOPATH_GENDIR := $(GOPATH_DIR)/$(GENDIR)

# Find all .proto files.
PROTO_FILES := $(wildcard opentelemetry/proto/*/*/*.proto opentelemetry/proto/*/*/*/*.proto)

# Function to execute a command. Note the empty line before endef to make sure each command
# gets executed separately instead of concatenated with previous one.
# Accepts command to execute as first parameter.
define exec-command
$(1)

endef

# CI build
.PHONY: ci
ci: gen-go gen-java gen-python gen-swagger

OTEL_DOCKER_PROTOBUF ?= otel/build-protobuf:latest
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path=${PWD}
PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf

PROTO_GEN_GO_DIR ?= $(GENDIR)/go
PROTO_GEN_JAVA_DIR ?= $(GENDIR)/java
PROTO_GEN_PYTHON_DIR ?= $(GENDIR)/python
PROTO_GEN_SWAGGER_OUTDIR ?= $(GENDIR)/openapi

# Generate ProtoBuf implementation for Go.
.PHONY: gen-go
gen-go:
rm -rf ./$(PROTO_GEN_GO_DIR)
mkdir -p ./$(PROTO_GEN_GO_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command,$(PROTOC) $(PROTO_INCLUDES) --gogo_out=plugins=grpc:./$(PROTO_GEN_GO_DIR) $(file)))
$(PROTOC) --grpc-gateway_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/trace/v1/trace_service_http.yaml:./$(PROTO_GEN_GO_DIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --grpc-gateway_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/metrics/v1/metrics_service_http.yaml:./$(PROTO_GEN_GO_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --grpc-gateway_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/logs/v1/logs_service_http.yaml:./$(PROTO_GEN_GO_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto

# Generate ProtoBuf implementation for Java.
.PHONY: gen-java
gen-java:
rm -rf ./$(PROTO_GEN_JAVA_DIR)
mkdir -p ./$(PROTO_GEN_JAVA_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --java_out=./$(PROTO_GEN_JAVA_DIR) $(file)))

# Generate ProtoBuf implementation for Python.
.PHONY: gen-python
gen-python:
rm -rf ./$(PROTO_GEN_PYTHON_DIR)
mkdir -p ./$(PROTO_GEN_PYTHON_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --python_out=./$(PROTO_GEN_PYTHON_DIR) $(file)))
$(PROTOC) --python_out=./$(PROTO_GEN_PYTHON_DIR) --grpc-python_out=./$(PROTO_GEN_PYTHON_DIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --python_out=./$(PROTO_GEN_PYTHON_DIR) --grpc-python_out=./$(PROTO_GEN_PYTHON_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --python_out=./$(PROTO_GEN_PYTHON_DIR) --grpc-python_out=./$(PROTO_GEN_PYTHON_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto

# Generate Swagger
.PHONY: gen-swagger
gen-swagger:
mkdir -p $(PROTO_GEN_SWAGGER_OUTDIR)
$(PROTOC) --swagger_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/trace/v1/trace_service_http.yaml:$(PROTO_GEN_SWAGGER_OUTDIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --swagger_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/metrics/v1/metrics_service_http.yaml:$(PROTO_GEN_SWAGGER_OUTDIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --swagger_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/logs/v1/logs_service_http.yaml:$(PROTO_GEN_SWAGGER_OUTDIR) opentelemetry/proto/collector/logs/v1/logs_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OpenTelemetry Collector Proto

This package describes the OpenTelemetry collector protocol.

## Packages

1. `common` package contains the common messages shared between different services.
2. `trace` package contains the Trace Service protos.
3. `metrics` package contains the Metrics Service protos.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2019, 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.

syntax = "proto3";

package opentelemetry.proto.collector.metrics.v1;

import "opentelemetry/proto/metrics/v1/metrics.proto";

option java_multiple_files = true;
option java_package = "io.opentelemetry.proto.collector.metrics.v1";
option java_outer_classname = "MetricsServiceProto";
option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/collector/metrics/v1";

// Service that can be used to push metrics between one Application
// instrumented with OpenTelemetry and a collector, or between a collector and a
// central collector.
service MetricsService {
// For performance reasons, it is recommended to keep this RPC
// alive for the entire life of the application.
rpc Export(ExportMetricsServiceRequest) returns (ExportMetricsServiceResponse) {}
}

message ExportMetricsServiceRequest {
// An array of ResourceMetrics.
// For data coming from a single resource this array will typically contain one
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
// data from multiple origins typically batch the data before forwarding further and
// in that case this array will contain multiple elements.
repeated opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
}

message ExportMetricsServiceResponse {
}
Loading