Skip to content

Commit 815dde0

Browse files
committed
Feat/ci lint (#71)
* fix ci lint
1 parent 91db2e6 commit 815dde0

File tree

177 files changed

+372
-158
lines changed

Some content is hidden

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

177 files changed

+372
-158
lines changed

.codeconv.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- "./rules/.*"
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will build a golang project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
33

4-
name: TestGo21
4+
name: GoTest
55

66
on:
77
push:
@@ -10,20 +10,29 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
1413
build:
1514
runs-on: ubuntu-latest
15+
strategy:
16+
# If you want to matrix build , you can append the following list.
17+
matrix:
18+
go_version:
19+
- 1.21
20+
- 1.22
21+
os:
22+
- ubuntu-latest
1623
steps:
1724
- uses: actions/checkout@v4
1825

1926
- name: Set up Go
2027
uses: actions/setup-go@v4
2128
with:
22-
go-version: '1.21'
29+
go-version: ${{ matrix.go_version }}
2330

2431
- name: Build
2532
run: make build
2633
- name: InstUt
27-
run: go test -v ./pkg/...
34+
run: go test -v ./pkg/... -coverprofile=coverage.txt -covermode=atomic
35+
- name: Coverage
36+
run: bash <(curl -s https://codecov.io/bash)
2837
- name: Test
2938
run: go test -short -timeout 50m -v github.com/alibaba/opentelemetry-go-auto-instrumentation/test

.github/workflows/go22.yml

-29
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ You can also explore [these examples](./example/) to get hands-on experience.
8080

8181

8282
We are progressively open-sourcing the libraries we have supported, and your contributions are very welcome.
83-
Please refer to [this document](./docs/how-to-add-a-new-rule.md) for guidance on how to write instrumentation
83+
Please refer to [this document](./docs/how-to-add-a-new-rule.md) for guidance on how to write instrumentation
8484
code for new frameworks.
8585

8686
# Community

api/api.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package api
1516

1617
// -----------------------------------------------------------------------------

api/exporter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package api
1516

1617
import (

api/ruledef.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package api
1516

1617
import (

example/benchmark/consumer/consumer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

example/benchmark/producer/producer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

example/demo/demo.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package main
1516

1617
import (

main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package main
1516

1617
import (

pkg/core/meter/meter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package meter
1516

1617
import "go.opentelemetry.io/otel/metric"

pkg/exporter.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package pkg
1516

1617
import (

pkg/inst-api-semconv/instrumenter/db/db_client_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package db
1516

1617
import (

pkg/inst-api-semconv/instrumenter/db/db_client_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package db
1516

1617
import (

pkg/inst-api-semconv/instrumenter/db/db_client_getter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package db
1516

1617
type DbClientCommonAttrsGetter[REQUEST any] interface {

pkg/inst-api-semconv/instrumenter/db/db_span_name_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package db
1516

1617
type DBSpanNameExtractor[REQUEST any] struct {

pkg/inst-api-semconv/instrumenter/db/db_span_name_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package db
1516

1617
import "testing"

pkg/inst-api-semconv/instrumenter/http/http_attrs_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package http
1516

1617
import (

pkg/inst-api-semconv/instrumenter/http/http_attrs_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package http
1516

1617
import (

pkg/inst-api-semconv/instrumenter/http/http_attrs_getter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package http
1516

1617
import "github.com/alibaba/opentelemetry-go-auto-instrumentation/pkg/inst-api-semconv/instrumenter/net"

pkg/inst-api-semconv/instrumenter/http/http_span_name_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package http
1516

1617
type HttpClientSpanNameExtractor[REQUEST any, RESPONSE any] struct {

pkg/inst-api-semconv/instrumenter/http/http_span_name_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package http
1516

1617
import "testing"

pkg/inst-api-semconv/instrumenter/http/http_status_code_converter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package http
1516

1617
type HttpStatusCodeConverter interface {

pkg/inst-api-semconv/instrumenter/http/http_status_code_converter_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package http
1516

1617
import "testing"

pkg/inst-api-semconv/instrumenter/message/message_attrs_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package message
1516

1617
import (

pkg/inst-api-semconv/instrumenter/message/message_attrs_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package message
1516

1617
import (

pkg/inst-api-semconv/instrumenter/message/message_attrs_getter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package message
1516

1617
type MessageAttrsGetter[REQUEST any, RESPONSE any] interface {

pkg/inst-api-semconv/instrumenter/message/message_span_name_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package message
1516

1617
const temp_destination_name = "(temporary)"

pkg/inst-api-semconv/instrumenter/message/message_span_name_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package message
1516

1617
import (

pkg/inst-api-semconv/instrumenter/net/network_attrs_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package net
1516

1617
import (

pkg/inst-api-semconv/instrumenter/net/network_attrs_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package net
1516

1617
import (

pkg/inst-api-semconv/instrumenter/net/network_attrs_getter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package net
1516

1617
type NetworkAttrsGetter[REQUEST any, RESPONSE any] interface {

pkg/inst-api-semconv/instrumenter/rpc/rpc_attrs_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package rpc
1516

1617
import (

pkg/inst-api-semconv/instrumenter/rpc/rpc_attrs_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package rpc
1516

1617
import (

pkg/inst-api-semconv/instrumenter/rpc/rpc_attrs_getter.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package rpc
1516

1617
type RpcAttrsGetter[REQUEST any] interface {

pkg/inst-api-semconv/instrumenter/rpc/rpc_span_name_extractor.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package rpc
1516

1617
type RpcSpanNameExtractor[REQUEST any] struct {

pkg/inst-api-semconv/instrumenter/rpc/rpc_span_name_extractor_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package rpc
1516

1617
import "testing"

pkg/inst-api/instrumenter/extractor.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package instrumenter
1516

1617
import (

0 commit comments

Comments
 (0)