-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into upgradedd
- Loading branch information
Showing
83 changed files
with
793 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/tools" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/exporters/metric/dogstatsd" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/exporters/metric/datadog" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/instrumentation/labstack/echo" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/instrumentation/go.mongodb.org/mongo-driver" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/instrumentation/gorilla/mux" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/instrumentation/gin-gonic/gin" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/instrumentation/macaron" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/instrumentation/runtime" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Dependabot-Tidier | ||
on: | ||
pull_request: | ||
types: [ labeled ] | ||
|
||
jobs: | ||
mod_tidier: | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'dependencies') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.14.0' | ||
- uses: evantorrie/mott-the-tidier@v1-beta | ||
id: modtidy | ||
with: | ||
gomods: '**/go.mod' | ||
gosum_only: true | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
id: autocommit | ||
with: | ||
commit_message: Auto-fix go.sum changes in dependent modules | ||
- name: changes | ||
run: | | ||
echo "Changes detected: ${{ steps.autocommit.outputs.changes_detected }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
# opentelemetry-go-contrib | ||
# OpenTelemetry-Go Contrib | ||
|
||
This repo contains packages that facilitates instrumenting libraries with Opentelemetry for | ||
distributed tracing and monitoring. | ||
[![Circle CI](https://circleci.com/gh/open-telemetry/opentelemetry-go-contrib.svg?style=svg)](https://circleci.com/gh/open-telemetry/opentelemetry-go-contrib) | ||
[![Docs](https://godoc.org/go.opentelemetry.io/contrib?status.svg)](https://pkg.go.dev/go.opentelemetry.io/contrib) | ||
[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/contrib)](https://goreportcard.com/report/go.opentelemetry.io/contrib) | ||
[![Gitter](https://badges.gitter.im/open-telemetry/opentelemetry-go.svg)](https://gitter.im/open-telemetry/opentelemetry-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
|
||
Collection of 3rd-party instrumentation and exporters for [OpenTelemetry-Go](https://github.com/open-telemetry/opentelemetry-go). | ||
|
||
## Contents | ||
|
||
- [Instrumentation](./instrumentation/): Packages providing OpenTelemetry instrumentation for 3rd-party libraries. | ||
- [Exporters](./exporters/): Packages providing OpenTelemetry exporters for 3rd-party telemetry systems. | ||
|
||
## Contributing | ||
|
||
For information on how to contribute, consult [the contributing guidelines](./CONTRIBUTING.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
#!/usr/bin/env bash | ||
|
||
# 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. | ||
|
||
# | ||
# This script is used for | ||
# a) creating a new tagged release of go.opentelemetry.io/contrib | ||
# b) bumping the referenced version of go.opentelemetry.io/otel | ||
# | ||
# The options can be used together or individually. | ||
# | ||
set -e | ||
|
||
help() { | ||
printf "\n" | ||
printf "Usage: %s [-o otel_tag] [-t tag]\n" "$0" | ||
printf "\t-o Otel release tag. Update all go.mod to reference go.opentelemetry.io/otel <otel_tag>.\n" | ||
printf "\t-t New unreleased tag. Update all go.mod with this tag.\n" | ||
exit 1 # Exit script after printing help | ||
} | ||
|
||
while getopts "t:o:" opt | ||
do | ||
case "$opt" in | ||
t ) TAG="$OPTARG" ;; | ||
o ) OTEL_TAG="$OPTARG" ;; | ||
? ) help ;; # Print help | ||
esac | ||
done | ||
|
||
declare -r SEMVER_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" | ||
|
||
validate_tag() { | ||
local tag_=$1 | ||
if [[ "${tag_}" =~ ${SEMVER_REGEX} ]]; then | ||
printf "%s is valid semver tag.\n" "${tag_}" | ||
else | ||
printf "%s is not a valid semver tag.\n" "${tag_}" | ||
return 1 | ||
fi | ||
} | ||
|
||
# Print help in case parameters are empty | ||
if [[ -z "$TAG" && -z "$OTEL_TAG" ]] | ||
then | ||
printf "At least one of '-o' or '-t' must be specified.\n" | ||
help | ||
fi | ||
|
||
|
||
## Validate tags first | ||
if [ -n "${OTEL_TAG}" ]; then | ||
validate_tag "${OTEL_TAG}" || exit $? | ||
# check that OTEL_TAG is a currently released tag for go.opentelemetry.io/otel | ||
TMPDIR=$(mktemp -d "/tmp/otel-contrib.XXXXXX") || exit 1 | ||
trap "rm -fr ${TMPDIR}" EXIT | ||
(cd "${TMPDIR}" && go mod init tagtest) | ||
# requires go 1.14 for support of '-modfile' | ||
if ! go get -modfile="${TMPDIR}/go.mod" -d -v "go.opentelemetry.io/otel@${OTEL_TAG}"; then | ||
printf "go.opentelemetry.io/otel %s does not exist. Please supply a valid tag\n" "${OTEL_TAG}" | ||
exit 1 | ||
fi | ||
fi | ||
if [ -n "${TAG}" ]; then | ||
validate_tag "${TAG}" || exit $? | ||
TAG_FOUND=$(git tag --list "${TAG}") | ||
if [[ ${TAG_FOUND} = "${TAG}" ]] ; then | ||
printf "Tag %s already exists\n" "${TAG}" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
cd "$(dirname "$0")" | ||
|
||
if ! git diff --quiet; then \ | ||
printf "Working tree is not clean, can't proceed\n" | ||
git status | ||
git diff | ||
exit 1 | ||
fi | ||
|
||
declare BRANCH_NAME=pre_release_${TAG} | ||
if [ -z "${TAG}" ]; then | ||
BRANCH_NAME=bump_otel_${OTEL_TAG} | ||
fi | ||
|
||
patch_gomods() { | ||
local pkg_=$1 | ||
local tag_=$2 | ||
# now do the same for all the directories underneath | ||
PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep -v 'tools' | sed 's|^\.\/||' | sort) | ||
# quote any '.' characters in the pkg name | ||
local quoted_pkg_=${pkg_//./\\.} | ||
for dir in $PACKAGE_DIRS; do | ||
cp "${dir}/go.mod" "${dir}/go.mod.bak" | ||
sed "s|${quoted_pkg_}\([^ ]*\) v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[^0-9]*.*$|${pkg_}\1 ${tag_}|" "${dir}/go.mod.bak" >"${dir}/go.mod" | ||
rm -f "${dir}/go.mod.bak" | ||
done | ||
} | ||
|
||
# branch off from existing master | ||
git checkout -b "${BRANCH_NAME}" master | ||
|
||
# Update go.mods | ||
if [ -n "${OTEL_TAG}" ]; then | ||
# first update the top most module | ||
go get "go.opentelemetry.io/otel@${OTEL_TAG}" | ||
patch_gomods go.opentelemetry.io/otel "${OTEL_TAG}" | ||
fi | ||
|
||
if [ -n "${TAG}" ]; then | ||
patch_gomods go.opentelemetry.io/contrib "${TAG}" | ||
fi | ||
|
||
git diff | ||
# Run lint to update go.sum | ||
make lint | ||
|
||
# Add changes and commit. | ||
git add . | ||
make ci | ||
declare COMMIT_MSG="Prepare for releasing $TAG" | ||
if [ -z "${TAG}" ]; then | ||
COMMIT_MSG="Bumping otel version to ${OTEL_TAG}" | ||
fi | ||
git commit -m "${COMMIT_MSG}" | ||
|
||
printf "Now run following to verify the changes.\ngit diff master\n" | ||
printf "\nThen push the changes to upstream\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This package provides all of its functionality through its | ||
// submodules. The submodules in the exporters directory provide | ||
// implementations for trace and metric exporters for third-party | ||
// collectors, and submodules in the plugins directory provide the | ||
// collectors, and submodules in the instrumentation directory provide the | ||
// instrumentation for the popular go libraries. | ||
package contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.