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

chore: re-enable compilation checks, update otel and protobuf #2254

Merged
merged 6 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .github/workflows/elixir-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
run: mix lint --only warnings
- name: Code Quality - Formatting
run: mix test.format
# - name: Compilation Warnings
# run: mix test.compile
- name: Compilation Warnings
run: mix test.compile
- name: Tests
run: mix do ecto.create, ecto.migrate, test
# - name: Security - Sobelow Code Scan
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ elixir 1.17.3-otp-27
nodejs 18.13.0
rust 1.64.0
erlang 27.1.2
protoc 28.0
3 changes: 2 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Dev Env Setup

1. Install dependencies with `asdf` using `asdf install`
1. Run `make setup`, which will:
1. Install dependencies with `asdf` using `asdf install`
2. Decrypt secrets with `make decrypt.dev`. It will decrypt two files:
1. Dev secrets - `.dev.env`
2. Google JWT key - `.gcloud.json`
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ test.only:
.PHONY: test test.only

setup: setup.node
# install dependencies
asdf install

# add protobuf install
mix escript.install hex protobuf
asdf reshim
# run elixir setup
mix setup

setup.node:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Opentelemetry.Proto.Collector.Logs.V1.ExportLogsServiceRequest do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :resource_logs, 1,
repeated: true,
Expand All @@ -10,7 +11,8 @@ end

defmodule Opentelemetry.Proto.Collector.Logs.V1.ExportLogsServiceResponse do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :partial_success, 1,
type: Opentelemetry.Proto.Collector.Logs.V1.ExportLogsPartialSuccess,
Expand All @@ -19,17 +21,19 @@ end

defmodule Opentelemetry.Proto.Collector.Logs.V1.ExportLogsPartialSuccess do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :rejected_log_records, 1, type: :int64, json_name: "rejectedLogRecords"
field :error_message, 2, type: :string, json_name: "errorMessage"
end

defmodule Opentelemetry.Proto.Collector.Logs.V1.LogsService.Service do
@moduledoc false

use GRPC.Service,
name: "opentelemetry.proto.collector.logs.v1.LogsService",
protoc_gen_elixir_version: "0.11.0"
protoc_gen_elixir_version: "0.13.0"

rpc(
:Export,
Expand All @@ -40,5 +44,6 @@ end

defmodule Opentelemetry.Proto.Collector.Logs.V1.LogsService.Stub do
@moduledoc false

use GRPC.Stub, service: Opentelemetry.Proto.Collector.Logs.V1.LogsService.Service
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Opentelemetry.Proto.Collector.Metrics.V1.ExportMetricsServiceRequest do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :resource_metrics, 1,
repeated: true,
Expand All @@ -10,7 +11,8 @@ end

defmodule Opentelemetry.Proto.Collector.Metrics.V1.ExportMetricsServiceResponse do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :partial_success, 1,
type: Opentelemetry.Proto.Collector.Metrics.V1.ExportMetricsPartialSuccess,
Expand All @@ -19,17 +21,19 @@ end

defmodule Opentelemetry.Proto.Collector.Metrics.V1.ExportMetricsPartialSuccess do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :rejected_data_points, 1, type: :int64, json_name: "rejectedDataPoints"
field :error_message, 2, type: :string, json_name: "errorMessage"
end

defmodule Opentelemetry.Proto.Collector.Metrics.V1.MetricsService.Service do
@moduledoc false

use GRPC.Service,
name: "opentelemetry.proto.collector.metrics.v1.MetricsService",
protoc_gen_elixir_version: "0.11.0"
protoc_gen_elixir_version: "0.13.0"

rpc(
:Export,
Expand All @@ -40,5 +44,6 @@ end

defmodule Opentelemetry.Proto.Collector.Metrics.V1.MetricsService.Stub do
@moduledoc false

use GRPC.Stub, service: Opentelemetry.Proto.Collector.Metrics.V1.MetricsService.Service
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
defmodule Opentelemetry.Proto.Collector.Profiles.V1development.ExportProfilesServiceRequest do
@moduledoc false

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :resource_profiles, 1,
repeated: true,
type: Opentelemetry.Proto.Profiles.V1development.ResourceProfiles,
json_name: "resourceProfiles"
end

defmodule Opentelemetry.Proto.Collector.Profiles.V1development.ExportProfilesServiceResponse do
@moduledoc false

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :partial_success, 1,
type: Opentelemetry.Proto.Collector.Profiles.V1development.ExportProfilesPartialSuccess,
json_name: "partialSuccess"
end

defmodule Opentelemetry.Proto.Collector.Profiles.V1development.ExportProfilesPartialSuccess do
@moduledoc false

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :rejected_profiles, 1, type: :int64, json_name: "rejectedProfiles"
field :error_message, 2, type: :string, json_name: "errorMessage"
end

defmodule Opentelemetry.Proto.Collector.Profiles.V1development.ProfilesService.Service do
@moduledoc false

use GRPC.Service,
name: "opentelemetry.proto.collector.profiles.v1development.ProfilesService",
protoc_gen_elixir_version: "0.13.0"

rpc(
:Export,
Opentelemetry.Proto.Collector.Profiles.V1development.ExportProfilesServiceRequest,
Opentelemetry.Proto.Collector.Profiles.V1development.ExportProfilesServiceResponse
)
end

defmodule Opentelemetry.Proto.Collector.Profiles.V1development.ProfilesService.Stub do
@moduledoc false

use GRPC.Stub,
service: Opentelemetry.Proto.Collector.Profiles.V1development.ProfilesService.Service
end
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
defmodule Opentelemetry.Proto.Collector.Trace.V1.ExportTraceServiceRequest do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

field(:resource_spans, 1,
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :resource_spans, 1,
repeated: true,
type: Opentelemetry.Proto.Trace.V1.ResourceSpans,
json_name: "resourceSpans"
)
end

defmodule Opentelemetry.Proto.Collector.Trace.V1.ExportTraceServiceResponse do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

field(:partial_success, 1,
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :partial_success, 1,
type: Opentelemetry.Proto.Collector.Trace.V1.ExportTracePartialSuccess,
json_name: "partialSuccess"
)
end

defmodule Opentelemetry.Proto.Collector.Trace.V1.ExportTracePartialSuccess do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

field(:rejected_spans, 1, type: :int64, json_name: "rejectedSpans")
field(:error_message, 2, type: :string, json_name: "errorMessage")
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :rejected_spans, 1, type: :int64, json_name: "rejectedSpans"
field :error_message, 2, type: :string, json_name: "errorMessage"
end

defmodule Opentelemetry.Proto.Collector.Trace.V1.TraceService.Service do
@moduledoc false

use GRPC.Service,
name: "opentelemetry.proto.collector.trace.v1.TraceService",
protoc_gen_elixir_version: "0.11.0"
protoc_gen_elixir_version: "0.13.0"

rpc(
:Export,
stream(Opentelemetry.Proto.Collector.Trace.V1.ExportTraceServiceRequest),
stream(Opentelemetry.Proto.Collector.Trace.V1.ExportTraceServiceResponse)
Opentelemetry.Proto.Collector.Trace.V1.ExportTraceServiceRequest,
Opentelemetry.Proto.Collector.Trace.V1.ExportTraceServiceResponse
)
end

defmodule Opentelemetry.Proto.Collector.Trace.V1.TraceService.Stub do
@moduledoc false

use GRPC.Stub, service: Opentelemetry.Proto.Collector.Trace.V1.TraceService.Service
end
15 changes: 10 additions & 5 deletions lib/logflare_grpc/opentelemetry/proto/common/v1/common.pb.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Opentelemetry.Proto.Common.V1.AnyValue do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

oneof(:value, 0)

Expand All @@ -24,29 +25,33 @@ end

defmodule Opentelemetry.Proto.Common.V1.ArrayValue do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :values, 1, repeated: true, type: Opentelemetry.Proto.Common.V1.AnyValue
end

defmodule Opentelemetry.Proto.Common.V1.KeyValueList do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :values, 1, repeated: true, type: Opentelemetry.Proto.Common.V1.KeyValue
end

defmodule Opentelemetry.Proto.Common.V1.KeyValue do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :key, 1, type: :string
field :value, 2, type: Opentelemetry.Proto.Common.V1.AnyValue
end

defmodule Opentelemetry.Proto.Common.V1.InstrumentationScope do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :name, 1, type: :string
field :version, 2, type: :string
Expand Down
22 changes: 14 additions & 8 deletions lib/logflare_grpc/opentelemetry/proto/logs/v1/logs.pb.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Opentelemetry.Proto.Logs.V1.SeverityNumber do
@moduledoc false
use Protobuf, enum: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :SEVERITY_NUMBER_UNSPECIFIED, 0
field :SEVERITY_NUMBER_TRACE, 1
Expand Down Expand Up @@ -31,15 +32,17 @@ end

defmodule Opentelemetry.Proto.Logs.V1.LogRecordFlags do
@moduledoc false
use Protobuf, enum: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

field :LOG_RECORD_FLAG_UNSPECIFIED, 0
field :LOG_RECORD_FLAG_TRACE_FLAGS_MASK, 255
use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :LOG_RECORD_FLAGS_DO_NOT_USE, 0
field :LOG_RECORD_FLAGS_TRACE_FLAGS_MASK, 255
end

defmodule Opentelemetry.Proto.Logs.V1.LogsData do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :resource_logs, 1,
repeated: true,
Expand All @@ -49,7 +52,8 @@ end

defmodule Opentelemetry.Proto.Logs.V1.ResourceLogs do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :resource, 1, type: Opentelemetry.Proto.Resource.V1.Resource

Expand All @@ -63,7 +67,8 @@ end

defmodule Opentelemetry.Proto.Logs.V1.ScopeLogs do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :scope, 1, type: Opentelemetry.Proto.Common.V1.InstrumentationScope

Expand All @@ -77,7 +82,8 @@ end

defmodule Opentelemetry.Proto.Logs.V1.LogRecord do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"

field :time_unix_nano, 1, type: :fixed64, json_name: "timeUnixNano"
field :observed_time_unix_nano, 11, type: :fixed64, json_name: "observedTimeUnixNano"
Expand Down
Loading
Loading