Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/gitproviderreceiver] rename to githubreceiver #34731

Merged
merged 16 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
28 changes: 28 additions & 0 deletions .chloggen/gitprovider-rename.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: gitprovider
adrielp marked this conversation as resolved.
Show resolved Hide resolved

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: The Git Provider Receiver has been renamed to VCS Provider Receiver.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [34731]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
This rename was to better match the OpenTelemetry semantic convention changes in v1.27.0.

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ receiver/filelogreceiver/ @open-teleme
receiver/filestatsreceiver/ @open-telemetry/collector-contrib-approvers @atoulme
receiver/flinkmetricsreceiver/ @open-telemetry/collector-contrib-approvers @JonathanWamsley @djaglowski
receiver/fluentforwardreceiver/ @open-telemetry/collector-contrib-approvers @dmitryax
receiver/gitproviderreceiver/ @open-telemetry/collector-contrib-approvers @adrielp @andrzej-stencel
receiver/googlecloudmonitoringreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @TylerHelmuth @abhishek-at-cloudwerx
receiver/googlecloudpubsubreceiver/ @open-telemetry/collector-contrib-approvers @alexvanboxel
receiver/haproxyreceiver/ @open-telemetry/collector-contrib-approvers @atoulme @MovieStoreGuy
Expand Down Expand Up @@ -293,6 +292,7 @@ receiver/syslogreceiver/ @open-teleme
receiver/tcplogreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski
receiver/udplogreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski
receiver/vcenterreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski @schmikei @StefanKurek
receiver/vcsproviderreceiver/ @open-telemetry/collector-contrib-approvers @adrielp @andrzej-stencel
receiver/wavefrontreceiver/ @open-telemetry/collector-contrib-approvers @samiura
receiver/webhookeventreceiver/ @open-telemetry/collector-contrib-approvers @atoulme @shalper2
receiver/windowseventlogreceiver/ @open-telemetry/collector-contrib-approvers @armstrmi @pjanotti
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ body:
- receiver/filestats
- receiver/flinkmetrics
- receiver/fluentforward
- receiver/gitprovider
- receiver/googlecloudmonitoring
- receiver/googlecloudpubsub
- receiver/googlecloudspanner
Expand Down Expand Up @@ -288,6 +287,7 @@ body:
- receiver/tcplog
- receiver/udplog
- receiver/vcenter
- receiver/vcsprovider
- receiver/wavefront
- receiver/webhookevent
- receiver/windowseventlog
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ body:
- receiver/filestats
- receiver/flinkmetrics
- receiver/fluentforward
- receiver/gitprovider
- receiver/googlecloudmonitoring
- receiver/googlecloudpubsub
- receiver/googlecloudspanner
Expand Down Expand Up @@ -282,6 +281,7 @@ body:
- receiver/tcplog
- receiver/udplog
- receiver/vcenter
- receiver/vcsprovider
- receiver/wavefront
- receiver/webhookevent
- receiver/windowseventlog
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ body:
- receiver/filestats
- receiver/flinkmetrics
- receiver/fluentforward
- receiver/gitprovider
- receiver/googlecloudmonitoring
- receiver/googlecloudpubsub
- receiver/googlecloudspanner
Expand Down Expand Up @@ -282,6 +281,7 @@ body:
- receiver/tcplog
- receiver/udplog
- receiver/vcenter
- receiver/vcsprovider
- receiver/wavefront
- receiver/webhookevent
- receiver/windowseventlog
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/unmaintained.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ body:
- receiver/filestats
- receiver/flinkmetrics
- receiver/fluentforward
- receiver/gitprovider
- receiver/googlecloudmonitoring
- receiver/googlecloudpubsub
- receiver/googlecloudspanner
Expand Down Expand Up @@ -287,6 +286,7 @@ body:
- receiver/tcplog
- receiver/udplog
- receiver/vcenter
- receiver/vcsprovider
- receiver/wavefront
- receiver/webhookevent
- receiver/windowseventlog
Expand Down
6 changes: 0 additions & 6 deletions receiver/gitproviderreceiver/doc.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Git Provider Receiver
# VCS Provider Receiver

<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [development]: metrics |
| Distributions | [] |
| 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) |
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fvcsprovider%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fvcsprovider) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fvcsprovider%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fvcsprovider) |
| [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) |

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

The Git Provider receiver scrapes data from Version Control Systems (VCS) that use Git as their underlying technology.
The VCS Provider receiver scrapes data from Version Control Systems (VCS).

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.
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.

The current default set of metrics common across all vendors can be found in [documentation.md](./documentation.md).
The current default set of metrics common across all vendors can be found in
[documentation.md](./documentation.md).

These VCS metrics can be used as leading indicators ([capabilities][doracap]) to the [DORA][dorafour] metrics; helping provide insight into modern-day engineering practices.
These VCS metrics can be used as leading indicators ([capabilities][doracap])
to the [DORA][dorafour] metrics; helping provide insight into modern-day
engineering practices.

[doracap]: https://dora.dev/capabilities/
[dorafour]: https://dora.dev/guides/dora-metrics-four-keys/
Expand All @@ -31,7 +36,7 @@ The collection interval is common to all scrapers and is set to 30 seconds by de
> and organizations. You may run into significantly more rate limiting.

```yaml
gitprovider:
vcsprovider:
collection_interval: <duration> #default = 30s recommended 300s
scrapers:
<scraper1>:
Expand All @@ -47,7 +52,7 @@ extensions:
token: ${env:GH_PAT}

receivers:
gitprovider:
vcsprovider:
initial_delay: 1s
collection_interval: 60s
scrapers:
Expand All @@ -64,7 +69,7 @@ service:
extensions: [bearertokenauth/github]
pipelines:
metrics:
receivers: [..., gitprovider]
receivers: [..., vcsprovider]
processors: []
exporters: [...]
```
Expand Down Expand Up @@ -92,4 +97,4 @@ The available scrapers are:
For additional context on GitHub scraper limitations and inner workings please
see the [GitHub Scraper README][ghsread].

[ghsread]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/gitproviderreceiver/internal/scraper/githubscraper/README.md#github-limitations
[ghsread]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/vcsproviderreceiver/internal/scraper/githubscraper/README.md#github-limitations
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package gitproviderreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver"
package vcsproviderreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver"

import (
"errors"
Expand All @@ -11,15 +11,15 @@ import (
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/receiver/scraperhelper"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal/metadata"
)

const (
scrapersKey = "scrapers"
)

// Config that is exposed to this github receiver through the OTEL config.yaml
// Config that is exposed to this vcs provider receiver through the OTEL config.yaml
type Config struct {
scraperhelper.ControllerConfig `mapstructure:",squash"`
Scrapers map[string]internal.Config `mapstructure:"scrapers"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package gitproviderreceiver
package vcsproviderreceiver

import (
"path/filepath"
Expand All @@ -15,9 +15,9 @@ import (
"go.opentelemetry.io/collector/otelcol/otelcoltest"
"go.opentelemetry.io/collector/receiver/scraperhelper"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/scraper/githubscraper"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal/scraper/githubscraper"
)

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

require.Contains(t, err.Error(), "error reading configuration for \"gitprovider\": invalid scraper key: \"invalidscraperkey\"")
require.Contains(t, err.Error(), "error reading configuration for \"vcsprovider\": invalid scraper key: \"invalidscraperkey\"")
}

func TestConfig_Unmarshal(t *testing.T) {
Expand Down
6 changes: 6 additions & 0 deletions receiver/vcsproviderreceiver/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

package vcsproviderreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)

# gitprovider
# vcsprovider

## Default Metrics

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package gitproviderreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver"
package vcsproviderreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver"

import (
"context"
Expand All @@ -13,22 +13,22 @@ import (
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/collector/receiver/scraperhelper"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal/scraper/githubscraper"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal/scraper/githubscraper"
)

// This file implements a factory for the git provider receiver
// This file implements a factory for the vcs provider receiver

var (
scraperFactories = map[string]internal.ScraperFactory{
githubscraper.TypeStr: &githubscraper.Factory{},
}

errConfigNotValid = errors.New("configuration is not valid for the git provider receiver")
errConfigNotValid = errors.New("configuration is not valid for the vcs provider receiver")
)

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

for key, cfg := range cfg.Scrapers {
gitProviderScraper, err := createGitProviderScraper(ctx, params, key, cfg, factories)
vcsProviderScraper, err := createVcsProviderScraper(ctx, params, key, cfg, factories)

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

scraperControllerOptions = append(scraperControllerOptions, scraperhelper.AddScraper(gitProviderScraper))
scraperControllerOptions = append(scraperControllerOptions, scraperhelper.AddScraper(vcsProviderScraper))
}

return scraperControllerOptions, nil
}

func createGitProviderScraper(
func createVcsProviderScraper(
ctx context.Context,
params receiver.Settings,
key string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package gitproviderreceiver
package vcsproviderreceiver

import (
"context"
Expand All @@ -14,7 +14,7 @@ import (
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/receiver/receivertest"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver/internal"
)

var creationSet = receivertest.NewNopSettings()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/gitproviderreceiver
module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcsproviderreceiver

go 1.22.0

Expand Down Expand Up @@ -121,7 +121,7 @@ require (
golang.org/x/text v0.17.0 // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240808171019-573a1156607a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading