Skip to content

Commit 903eec5

Browse files
adrielpandrzej-stencelmx-psi
authored
[receiver/gitproviderreceiver] rename to githubreceiver (#34731)
**Description:** <Describe what has changed.> Renames `gitproviderreceiver` to `githubreceiver` to better align with OpenTelemetry Semantic Conventions v1.27.0+ and allow for tracing and log signals in the future. --------- Co-authored-by: Andrzej Stencel <[email protected]> Co-authored-by: Pablo Baeyens <[email protected]>
1 parent 499cfd8 commit 903eec5

Some content is hidden

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

50 files changed

+141
-113
lines changed

.chloggen/gitprovider-rename.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: gitproviderreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: The Git Provider Receiver has been renamed to GitHub Receiver.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [34731]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
This rename was to better match the OpenTelemetry semantic convention changes in v1.27.0
20+
and allows for Traces and Log signals to be added to this component. Traces
21+
as mentioned in issue #27460 will be added in a future release to this component.
22+
23+
# If your change doesn't affect end users or the exported elements of any package,
24+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
25+
# Optional: The change log or logs in which this entry should be included.
26+
# e.g. '[user]' or '[user, api]'
27+
# Include 'user' if the change is relevant to end users.
28+
# Include 'api' if there is a change to a library API.
29+
# Default: '[user]'
30+
change_logs: []

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ receiver/filelogreceiver/ @open-teleme
236236
receiver/filestatsreceiver/ @open-telemetry/collector-contrib-approvers @atoulme
237237
receiver/flinkmetricsreceiver/ @open-telemetry/collector-contrib-approvers @JonathanWamsley @djaglowski
238238
receiver/fluentforwardreceiver/ @open-telemetry/collector-contrib-approvers @dmitryax
239-
receiver/gitproviderreceiver/ @open-telemetry/collector-contrib-approvers @adrielp @andrzej-stencel @crobert-1
239+
receiver/githubreceiver/ @open-telemetry/collector-contrib-approvers @adrielp @andrzej-stencel @crobert-1
240240
receiver/googlecloudmonitoringreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @TylerHelmuth @abhishek-at-cloudwerx
241241
receiver/googlecloudpubsubreceiver/ @open-telemetry/collector-contrib-approvers @alexvanboxel
242242
receiver/haproxyreceiver/ @open-telemetry/collector-contrib-approvers @atoulme @MovieStoreGuy

.github/ISSUE_TEMPLATE/bug_report.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ body:
230230
- receiver/filestats
231231
- receiver/flinkmetrics
232232
- receiver/fluentforward
233-
- receiver/gitprovider
233+
- receiver/github
234234
- receiver/googlecloudmonitoring
235235
- receiver/googlecloudpubsub
236236
- receiver/googlecloudspanner

.github/ISSUE_TEMPLATE/feature_request.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ body:
224224
- receiver/filestats
225225
- receiver/flinkmetrics
226226
- receiver/fluentforward
227-
- receiver/gitprovider
227+
- receiver/github
228228
- receiver/googlecloudmonitoring
229229
- receiver/googlecloudpubsub
230230
- receiver/googlecloudspanner

.github/ISSUE_TEMPLATE/other.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ body:
224224
- receiver/filestats
225225
- receiver/flinkmetrics
226226
- receiver/fluentforward
227-
- receiver/gitprovider
227+
- receiver/github
228228
- receiver/googlecloudmonitoring
229229
- receiver/googlecloudpubsub
230230
- receiver/googlecloudspanner

.github/ISSUE_TEMPLATE/unmaintained.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ body:
229229
- receiver/filestats
230230
- receiver/flinkmetrics
231231
- receiver/fluentforward
232-
- receiver/gitprovider
232+
- receiver/github
233233
- receiver/googlecloudmonitoring
234234
- receiver/googlecloudpubsub
235235
- receiver/googlecloudspanner

receiver/gitproviderreceiver/README.md renamed to receiver/githubreceiver/README.md

+21-23
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
# Git Provider Receiver
1+
# GitHub Receiver
22

33
<!-- status autogenerated section -->
44
| Status | |
55
| ------------- |-----------|
66
| Stability | [development]: metrics |
77
| Distributions | [] |
8-
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fgitprovider%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fgitprovider) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fgitprovider%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fgitprovider) |
8+
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fgithub%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fgithub) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fgithub%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fgithub) |
99
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@adrielp](https://www.github.com/adrielp), [@andrzej-stencel](https://www.github.com/andrzej-stencel), [@crobert-1](https://www.github.com/crobert-1) |
1010

1111
[development]: https://github.com/open-telemetry/opentelemetry-collector#development
1212
<!-- end autogenerated section -->
1313

14-
The Git Provider receiver scrapes data from Version Control Systems (VCS) that use Git as their underlying technology.
14+
The GitHub receiver receives data from [GitHub](https://github.com). As a
15+
starting point it scrapes metrics from repositories but will be extended to
16+
include traces and logs.
1517

16-
As a starting point, this receiver can infer many of the same core VCS metrics across vendors, while being able to receive additional data specific to vendors.
18+
The current default set of metrics can be found in
19+
[documentation.md](./documentation.md).
1720

18-
The current default set of metrics common across all vendors can be found in [documentation.md](./documentation.md).
19-
20-
These VCS metrics can be used as leading indicators ([capabilities][doracap]) to the [DORA][dorafour] metrics; helping provide insight into modern-day engineering practices.
21+
These metrics can be used as leading indicators ([capabilities][doracap])
22+
to the [DORA][dorafour] metrics; helping provide insight into modern-day
23+
engineering practices.
2124

2225
[doracap]: https://dora.dev/capabilities/
2326
[dorafour]: https://dora.dev/guides/dora-metrics-four-keys/
@@ -31,7 +34,7 @@ The collection interval is common to all scrapers and is set to 30 seconds by de
3134
> and organizations. You may run into significantly more rate limiting.
3235
3336
```yaml
34-
gitprovider:
37+
github:
3538
collection_interval: <duration> #default = 30s recommended 300s
3639
scrapers:
3740
<scraper1>:
@@ -47,7 +50,7 @@ extensions:
4750
token: ${env:GH_PAT}
4851

4952
receivers:
50-
gitprovider:
53+
github:
5154
initial_delay: 1s
5255
collection_interval: 60s
5356
scrapers:
@@ -64,23 +67,16 @@ service:
6467
extensions: [bearertokenauth/github]
6568
pipelines:
6669
metrics:
67-
receivers: [..., gitprovider]
70+
receivers: [..., github]
6871
processors: []
6972
exporters: [...]
7073
```
7174
72-
This receiver is developed upstream in the [liatrio-otel-collector distribution](https://github.com/liatrio/liatrio-otel-collector)
73-
where a quick start exists with an [example config](https://github.com/liatrio/liatrio-otel-collector/blob/main/config/config.yaml)
74-
75-
A Grafana Dashboard exists on the marketplace for this receiver and can be
76-
found [here](https://grafana.com/grafana/dashboards/20976-engineering-effectiveness-metrics/).
75+
A Grafana Dashboard exists on the marketplace for metrics from this receiver
76+
and can be found
77+
[here](https://grafana.com/grafana/dashboards/20976-engineering-effectiveness-metrics/).
7778
78-
The available scrapers are:
79-
| Scraper | Description |
80-
|----------|-------------------------|
81-
| [github] | VCS Metrics from [GitHub](https://github.com/) |
82-
83-
## GitHub Scraper
79+
## Scraping
8480
8581
> Important:
8682
> * The GitHub scraper does not emit metrics for branches that have not had
@@ -89,7 +85,9 @@ The available scrapers are:
8985
> change when rebases occur, recreating the commits with new timestamps.
9086
9187
88+
<!-- TODO: Combine this documentation once the scraper code is restructured due scope change -->
89+
9290
For additional context on GitHub scraper limitations and inner workings please
93-
see the [GitHub Scraper README][ghsread].
91+
see the [Scraping README][ghsread].
9492
95-
[ghsread]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/gitproviderreceiver/internal/scraper/githubscraper/README.md#github-limitations
93+
[ghsread]: internal/scraper/githubscraper/README.md#github-limitations

receiver/gitproviderreceiver/config.go renamed to receiver/githubreceiver/config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package gitproviderreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver"
4+
package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver"
55

66
import (
77
"errors"
@@ -11,8 +11,8 @@ import (
1111
"go.opentelemetry.io/collector/confmap"
1212
"go.opentelemetry.io/collector/receiver/scraperhelper"
1313

14-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
15-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/metadata"
14+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal"
15+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal/metadata"
1616
)
1717

1818
const (

receiver/gitproviderreceiver/config_test.go renamed to receiver/githubreceiver/config_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package gitproviderreceiver
4+
package githubreceiver
55

66
import (
77
"path/filepath"
@@ -15,9 +15,9 @@ import (
1515
"go.opentelemetry.io/collector/otelcol/otelcoltest"
1616
"go.opentelemetry.io/collector/receiver/scraperhelper"
1717

18-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
19-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/metadata"
20-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/scraper/githubscraper"
18+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal"
19+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal/metadata"
20+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal/scraper/githubscraper"
2121
)
2222

2323
func TestLoadConfig(t *testing.T) {
@@ -80,7 +80,7 @@ func TestLoadInvalidConfig_InvalidScraperKey(t *testing.T) {
8080
// nolint:staticcheck
8181
_, err = otelcoltest.LoadConfigAndValidate(filepath.Join("testdata", "config-invalidscraperkey.yaml"), factories)
8282

83-
require.Contains(t, err.Error(), "error reading configuration for \"gitprovider\": invalid scraper key: \"invalidscraperkey\"")
83+
require.Contains(t, err.Error(), "error reading configuration for \"github\": invalid scraper key: \"invalidscraperkey\"")
8484
}
8585

8686
func TestConfig_Unmarshal(t *testing.T) {

receiver/githubreceiver/doc.go

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
//go:generate mdatagen metadata.yaml
5+
6+
package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver"

receiver/gitproviderreceiver/documentation.md renamed to receiver/githubreceiver/documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)
22

3-
# gitprovider
3+
# github
44

55
## Default Metrics
66

receiver/gitproviderreceiver/factory.go renamed to receiver/githubreceiver/factory.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package gitproviderreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver"
4+
package githubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver"
55

66
import (
77
"context"
@@ -13,22 +13,22 @@ import (
1313
"go.opentelemetry.io/collector/receiver"
1414
"go.opentelemetry.io/collector/receiver/scraperhelper"
1515

16-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
17-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/metadata"
18-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/scraper/githubscraper"
16+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal"
17+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal/metadata"
18+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal/scraper/githubscraper"
1919
)
2020

21-
// This file implements a factory for the git provider receiver
21+
// This file implements a factory for the github receiver
2222

2323
var (
2424
scraperFactories = map[string]internal.ScraperFactory{
2525
githubscraper.TypeStr: &githubscraper.Factory{},
2626
}
2727

28-
errConfigNotValid = errors.New("configuration is not valid for the git provider receiver")
28+
errConfigNotValid = errors.New("configuration is not valid for the github receiver")
2929
)
3030

31-
// NewFactory creates a factory for the git provider receiver
31+
// NewFactory creates a factory for the github receiver
3232
func NewFactory() receiver.Factory {
3333
return receiver.NewFactory(
3434
metadata.Type,
@@ -52,7 +52,7 @@ func createDefaultConfig() component.Config {
5252
ControllerConfig: scraperhelper.NewDefaultControllerConfig(),
5353
// TODO: metrics builder configuration may need to be in each sub scraper,
5454
// TODO: for right now setting here because the metrics in this receiver will apply to all
55-
// TODO: scrapers defined as a common set of gitprovider
55+
// TODO: scrapers defined as a common set of github
5656
// TODO: aqp completely remove these comments if the metrics build config
5757
// needs to be defined in each scraper
5858
// MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(),
@@ -96,19 +96,19 @@ func createAddScraperOpts(
9696
scraperControllerOptions := make([]scraperhelper.ScraperControllerOption, 0, len(cfg.Scrapers))
9797

9898
for key, cfg := range cfg.Scrapers {
99-
gitProviderScraper, err := createGitProviderScraper(ctx, params, key, cfg, factories)
99+
githubScraper, err := createGitHubScraper(ctx, params, key, cfg, factories)
100100

101101
if err != nil {
102102
return nil, fmt.Errorf("failed to create scraper %q: %w", key, err)
103103
}
104104

105-
scraperControllerOptions = append(scraperControllerOptions, scraperhelper.AddScraper(gitProviderScraper))
105+
scraperControllerOptions = append(scraperControllerOptions, scraperhelper.AddScraper(githubScraper))
106106
}
107107

108108
return scraperControllerOptions, nil
109109
}
110110

111-
func createGitProviderScraper(
111+
func createGitHubScraper(
112112
ctx context.Context,
113113
params receiver.Settings,
114114
key string,

receiver/gitproviderreceiver/factory_test.go renamed to receiver/githubreceiver/factory_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package gitproviderreceiver
4+
package githubreceiver
55

66
import (
77
"context"
@@ -14,7 +14,7 @@ import (
1414
"go.opentelemetry.io/collector/consumer/consumertest"
1515
"go.opentelemetry.io/collector/receiver/receivertest"
1616

17-
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
17+
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver/internal"
1818
)
1919

2020
var creationSet = receivertest.NewNopSettings()

receiver/gitproviderreceiver/generated_component_test.go renamed to receiver/githubreceiver/generated_component_test.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/gitproviderreceiver/generated_package_test.go renamed to receiver/githubreceiver/generated_package_test.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/gitproviderreceiver/go.mod renamed to receiver/githubreceiver/go.mod

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver
1+
module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/githubreceiver
22

33
go 1.22.0
44

@@ -95,9 +95,9 @@ require (
9595
go.opentelemetry.io/collector/processor v0.108.1 // indirect
9696
go.opentelemetry.io/collector/service v0.108.1 // indirect
9797
go.opentelemetry.io/contrib/config v0.8.0 // indirect
98-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
98+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
9999
go.opentelemetry.io/contrib/propagators/b3 v1.28.0 // indirect
100-
go.opentelemetry.io/otel v1.28.0 // indirect
100+
go.opentelemetry.io/otel v1.29.0 // indirect
101101
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.4.0 // indirect
102102
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect
103103
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0 // indirect
@@ -108,11 +108,11 @@ require (
108108
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 // indirect
109109
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 // indirect
110110
go.opentelemetry.io/otel/log v0.4.0 // indirect
111-
go.opentelemetry.io/otel/metric v1.28.0 // indirect
111+
go.opentelemetry.io/otel/metric v1.29.0 // indirect
112112
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
113113
go.opentelemetry.io/otel/sdk/log v0.4.0 // indirect
114114
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
115-
go.opentelemetry.io/otel/trace v1.28.0 // indirect
115+
go.opentelemetry.io/otel/trace v1.29.0 // indirect
116116
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
117117
go.uber.org/multierr v1.11.0 // indirect
118118
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
@@ -121,7 +121,7 @@ require (
121121
golang.org/x/text v0.17.0 // indirect
122122
gonum.org/v1/gonum v0.15.1 // indirect
123123
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
124-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240808171019-573a1156607a // indirect
124+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c // indirect
125125
google.golang.org/grpc v1.65.0 // indirect
126126
google.golang.org/protobuf v1.34.2 // indirect
127127
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)