Skip to content

Cloud Logging: Sink management (ConfigServiceV2) not implemented #158

Description

@b-beyaz

Description
WriteLogEntries and ListLogEntries (LoggingServiceV2) work correctly, but
ConfigServiceV2 (CreateSink, ListSinks, UpdateSink, DeleteSink) returns
UNIMPLEMENTED:

grpc._channel._InactiveRpcError:
status = StatusCode.UNIMPLEMENTED
details = "Method not found: google.logging.v2.ConfigServiceV2/CreateSink"

Why this matters
Log sinks (routing logs to GCS/Pub/Sub/BigQuery destinations) are a core
part of the Cloud Logging workflow, especially for local testing of
"logs -> sink -> bucket" pipelines used with GKE workloads. Right now
there's no way to exercise this against floci-gcp — I had to build a
polling workaround (list entries + manually copy matches to GCS) just
to approximate the behavior for a training exercise.

Repro

  1. docker run -d -p 4588:4588 floci/floci-gcp:latest
  2. Use ConfigServiceV2Client with an insecure grpc channel to localhost:4588
  3. Call create_sink(parent="projects/", sink=LogSink(...))
  4. Observe UNIMPLEMENTED

Proposed scope (minimum viable)

  • CreateSink / GetSink / ListSinks / DeleteSink for GCS destinations first
    (Pub/Sub destinations as a fast-follow, since Pub/Sub is already emulated)
  • On WriteLogEntries, evaluate active sinks' filters and copy matching
    entries to the destination bucket as JSON objects, mirroring real
    Cloud Logging's export behavior
  • writer_identity can be a stub service account string, consistent with
    how IAM/SignBlob already returns stub values elsewhere in the project

Willing to contribute
I'd like to attempt a PR for this myself if a maintainer can point me at
the right place to start (I'm assuming this lives alongside the existing
LoggingServiceV2 implementation — happy to be pointed elsewhere). I'm
comfortable with Java but new to this codebase, so any guidance on the
module/package structure for gRPC services would help me get started
faster.

Environment
floci-gcp: latest (docker)
Client: google-cloud-logging (Python) via ConfigServiceV2GrpcTransport

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingloggingCloud Logging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions