Skip to content

Commit 70edddd

Browse files
committed
feat(otel): integrate OTEL using gRPC interceptor (#1050)
Because - Opentelemetry stack requires the application instrumented in observable layers and components. We desire to have Instill Core a middleware/interceptor approach so functions in handler, service and repository layer can be instrumented automatically. This commit - builds the ground of the instrument which enable handler OTEL tracing interceptor using the latest `x/otel`, `x/errors` and `x/log` package. - makes naming consistency across backend repos.
1 parent 82fe19d commit 70edddd

File tree

151 files changed

+1492
-2134
lines changed

Some content is hidden

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

151 files changed

+1492
-2134
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 170 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@
933933
* add component definition list endpoint ([#396](https://github.com/instill-ai/pipeline-backend/issues/396)) ([b8728c1](https://github.com/instill-ai/pipeline-backend/commit/b8728c16483fb68cdaed65dff191d2500ec06e4e))
934934
* rename blockchain connector type to application ([#397](https://github.com/instill-ai/pipeline-backend/issues/397)) ([80aa6a5](https://github.com/instill-ai/pipeline-backend/commit/80aa6a5c725fa18c34a84db4ec426f60461fd702))
935935
* support reference with `foo["bar"]` syntax ([#394](https://github.com/instill-ai/pipeline-backend/issues/394)) ([ed82215](https://github.com/instill-ai/pipeline-backend/commit/ed8221504572ba67e39367b651085df438306c7d))
936-
* use `mgmtPB.Owner` to embed the owner information in response ([#392](https://github.com/instill-ai/pipeline-backend/issues/392)) ([d071461](https://github.com/instill-ai/pipeline-backend/commit/d0714617e34aa7779947b153297a7bffea7bd08f))
936+
* use `mgmtpb.Owner` to embed the owner information in response ([#392](https://github.com/instill-ai/pipeline-backend/issues/392)) ([d071461](https://github.com/instill-ai/pipeline-backend/commit/d0714617e34aa7779947b153297a7bffea7bd08f))
937937

938938

939939
### Bug Fixes

Dockerfile.dev

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG GOLANG_VERSION=1.24.4
22
FROM golang:${GOLANG_VERSION}-bullseye
33

4-
ARG SERVICE_NAME
4+
ARG SERVICE_NAME SERVICE_VERSION
55

66
WORKDIR /${SERVICE_NAME}
77

@@ -117,4 +117,7 @@ RUN chown -R nobody:nogroup /${SERVICE_NAME}
117117
USER nobody:nogroup
118118
ENV HOME=${BASE_DOCLING_PATH}
119119

120+
ENV SERVICE_NAME=${SERVICE_NAME}
121+
ENV SERVICE_VERSION=${SERVICE_VERSION}
122+
120123
ENTRYPOINT ["tail", "-f", "/dev/null"]

cmd/init/definitionupdater/updater.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/instill-ai/pipeline-backend/pkg/repository"
1414

1515
componentstore "github.com/instill-ai/pipeline-backend/pkg/component/store"
16-
errdomain "github.com/instill-ai/pipeline-backend/pkg/errors"
17-
pb "github.com/instill-ai/protogen-go/pipeline/pipeline/v1beta"
16+
pipelinepb "github.com/instill-ai/protogen-go/pipeline/pipeline/v1beta"
17+
errorsx "github.com/instill-ai/x/errors"
1818
logx "github.com/instill-ai/x/log"
1919
)
2020

@@ -57,14 +57,14 @@ func UpdateComponentDefinitionIndex(ctx context.Context, repo repository.Reposit
5757
return nil
5858
}
5959

60-
func updateComponentDefinition(ctx context.Context, cd *pb.ComponentDefinition, repo repository.Repository) error {
60+
func updateComponentDefinition(ctx context.Context, cd *pipelinepb.ComponentDefinition, repo repository.Repository) error {
6161
uid, err := uuid.FromString(cd.GetUid())
6262
if err != nil {
6363
return fmt.Errorf("invalid UID in component definition %s: %w", cd.GetId(), err)
6464
}
6565

6666
inDB, err := repo.GetDefinitionByUID(ctx, uid)
67-
if err != nil && !errors.Is(err, errdomain.ErrNotFound) {
67+
if err != nil && !errors.Is(err, errorsx.ErrNotFound) {
6868
return fmt.Errorf("error fetching component definition %s from DB: %w", cd.GetId(), err)
6969
}
7070

0 commit comments

Comments
 (0)