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

feat(metering): add metering for logs #493

Merged
merged 4 commits into from
Dec 28, 2024
Merged

feat(metering): add metering for logs #493

merged 4 commits into from
Dec 28, 2024

Conversation

grandwizard28
Copy link
Collaborator

Features

  • Add a pkg metering with interface metering.Meter for Size and Count usage calculation
  • Add a pkg pdatagen for generating a wide variety of telemetry data for testing

@grandwizard28 grandwizard28 changed the title feat(metering): add logs for metering feat(metering): add metering for logs Dec 28, 2024
srikanthccv
srikanthccv previously approved these changes Dec 28, 2024
@shivanshuraj1333
Copy link
Member

=== RUN   TestLogsSize
    logs_test.go:24: 
        	Error Trace:	/Users/s/oss/sig/signoz-otel-collector/pkg/metering/v1/logs_test.go:24
        	Error:      	Not equal: 
        	            	expected: 3890
        	            	actual  : 3910
        	Test:       	TestLogsSize
--- FAIL: TestLogsSize (0.00s)

Expected :3890
Actual   :3910
<Click to see difference>


FAIL

Process finished with the exit code 1

@shivanshuraj1333
Copy link
Member

We should have this package in the gateway-collector as I don't think it is going to be used in the signoz-collector

See, https://signoz-team.slack.com/archives/C050MERV57W/p1735396691630329?thread_ts=1735138328.325539&cid=C050MERV57W for more details.

@grandwizard28 grandwizard28 merged commit 9756822 into main Dec 28, 2024
3 checks passed
@grandwizard28 grandwizard28 deleted the metering branch December 28, 2024 19:18
)

type logs struct {
Logger *zap.Logger
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant and not being use anywhere in the code.

func NewLogs(logger *zap.Logger) metering.Logs {
return &logs{
Logger: logger,
Sizer: metering.NewJSONSizer(logger),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is hardcoded for json, in the gateway, through the encoder one can also configure proto, https://github.com/SigNoz/opentelemetry-gateway/blob/main/internal/processor/signozlimiterprocessor/processor.go#L91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants