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

dubbo tracing support #17601

Closed
wbpcode opened this issue Aug 5, 2021 · 12 comments
Closed

dubbo tracing support #17601

wbpcode opened this issue Aug 5, 2021 · 12 comments
Labels
area/dubbo area/tracing enhancement Feature requests. Not bugs or questions.

Comments

@wbpcode
Copy link
Member

wbpcode commented Aug 5, 2021

After #16049 is completed, tracers can be used by various proxies, not just limited to HTTP. In envoy, now it is possible to trace dubbo/thrift streams as well as HTTP requests.

Dubbo Proxy would be a good start.

@wbpcode wbpcode added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Aug 5, 2021
@wbpcode
Copy link
Member Author

wbpcode commented Aug 5, 2021

cc @zyfjeff @lizan

@yanavlasov yanavlasov added area/tracing area/dubbo and removed triage Issue requires triage labels Aug 6, 2021
@github-actions
Copy link

github-actions bot commented Sep 5, 2021

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 5, 2021
@github-actions
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@yingjianjian
Copy link

cc @zyfjeff @lizan

Hello, has Dubbo trace supported it? I'm looking forward to it @wbpcode

@wbpcode
Copy link
Member Author

wbpcode commented May 20, 2022

cc @zyfjeff @lizan

Hello, has Dubbo trace supported it? I'm looking forward to it @wbpcode

sorry, it's not supported for now.

@wbpcode wbpcode reopened this May 20, 2022
@wbpcode wbpcode added help wanted Needs help! and removed stale stalebot believes this issue/PR has not been touched recently labels May 20, 2022
@tedli
Copy link
Contributor

tedli commented Jul 26, 2022

Hi,

I'm trying to add a filter of dubbo, like the Router do, for learning purpose. Currently only want to read from config and log something.

So, I created a filter, I want to read config using the config field of DubboFilter which is an Any. I give my filter a name, and register it with config field type envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager::Tracing, it built.
However when running, envoy complains about it don't know how to unmarsal yaml config to object.

DubboFilters::FilterFactoryCb LalalaFilterConfig::createFilterFactoryFromProtoTyped(
    [[maybe_unused]] const envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager::Tracing& proto,
    [[maybe_unused]] const std::string& stat_prefix,
    Server::Configuration::FactoryContext& context) {
    // log proto...
  return [&context](DubboFilters::FilterChainFactoryCallbacks& callbacks) -> void {
    callbacks.addFilter(std::make_shared<Lalala>(context.clusterManager()));
  };
}
[2022-07-26 17:01:19.835][9004][critical][main] [source/server/server.cc:116] error initializing configuration '/path/envoy.yaml': Unable to parse JSON as proto (INVALID_ARGUMENT:(dubbo_filters[1].config): invalid value Invalid type URL, unknown type: extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing for type Any)

Is there some docs about this? Or there already some other filters, codes that did things like this, that I can imitate?

P.S.: I tried config type using protobuf StringValue, so I can unmarsal string to whatever I want, but the StringValue lacks of Validate method, caused failed of building.

==========

I solved myself 💌. I missed envoy. in type url. here is my config looks like:

dubbo_filters:
- name: envoy.filters.dubbo.router
- name: lalala
  config:
    "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing
    provider:
      name: envoy.tracers.skywalking
      typed_config:
        "@type": type.googleapis.com/envoy.config.trace.v3.SkyWalkingConfig
        grpc_service:
          envoy_grpc:
            cluster_name: skywalking-oap
          timeout: 0.250s
        client_config:
          service_name: lalala-sidecar

It built and run. I can read config settings in my filter factory.

@tedli
Copy link
Contributor

tedli commented Jul 29, 2022

Hi @wbpcode ,

If I want to achieve tracing for dubbo_proxy, for the filter's config, I can just reuse the Tracing proto defined in http connection manager, rather than introduce a new proto.

Did I get it wrong?

@wbpcode
Copy link
Member Author

wbpcode commented Jul 29, 2022

Hi @wbpcode ,

If I want to achieve tracing for dubbo_proxy, for the filter's config, I can just reuse the Tracing proto defined in http connection manager, rather than introduce a new proto.

Did I get it wrong?

I think it'ok to reuse the exist Tracing proto for now. May be we will have protocol-independent proto for tracing in the future, but it will be something just like current Tracing proto.

@tedli
Copy link
Contributor

tedli commented Jul 29, 2022

Hi @wbpcode ,

SINGLETON_MANAGER_REGISTRATION(http_tracer_manager);

auto http_tracer_manager = context.singletonManager().getTyped<Tracing::HttpTracerManagerImpl>(
SINGLETON_MANAGER_REGISTERED_NAME(http_tracer_manager), [&context] {
return std::make_shared<Tracing::HttpTracerManagerImpl>(
std::make_unique<Tracing::TracerFactoryContextImpl>(
context.getServerFactoryContext(), context.messageValidationVisitor()));
});

I want to use the factory to create tracer implementation object like the http connection manager do. It uses singleton mechanism.

Should I import this in dubbo proxy, to reuse the singleton http_tracer_manager instance, or to imitate it, give a dubbo_tracer_manager like this:

DubboFilters::FilterFactoryCb LalalaFilterConfig::createFilterFactoryFromProtoTyped(
    const envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager::
        Tracing& proto,
    const std::string&, Server::Configuration::FactoryContext& context) {

  Tracing::HttpTracerSharedPtr tracer = nullptr;

  if (proto.has_provider()) {
    Utility::Singletons singletons = Utility::createSingletons(context);
    tracer = singletons.dubbo_tracer_manager_->getOrCreateHttpTracer(&proto.provider());
  }

  return [&context, tracer](DubboFilters::FilterChainFactoryCallbacks& callbacks) -> void {
    callbacks.addFilter(std::make_shared<Lalala>(context.clusterManager(), tracer));
  };
}

SINGLETON_MANAGER_REGISTRATION(dubbo_tracer_manager);

Utility::Singletons Utility::createSingletons(Server::Configuration::FactoryContext& context) {
  auto dubbo_tracer_manager = context.singletonManager().getTyped<Tracing::HttpTracerManagerImpl>(
      SINGLETON_MANAGER_REGISTERED_NAME(dubbo_tracer_manager), [&context] {
        return std::make_shared<Tracing::HttpTracerManagerImpl>(
            std::make_unique<Tracing::TracerFactoryContextImpl>(
                context.getServerFactoryContext(), context.messageValidationVisitor()));
      });
  return {dubbo_tracer_manager};
}

If import and reuse, the trade off is initialized some other object like the route_config_provider_manager, which is useless in dubbo_proxy. (the side effect in the http ver createSingletons()). Or if create a dubbo_tracer_manager, it go against the 'singleton' purpose.

Need some suggestion. Thanks.

tedli added a commit to tedli/envoy that referenced this issue Aug 11, 2022
@wbpcode
Copy link
Member Author

wbpcode commented Nov 14, 2023

Basically, this could be achieved by the new generic proxy-based dubbo proxy. So, I will close it. If someone still want this, ping me to reopen it or create a new issue.

@wbpcode wbpcode closed this as completed Nov 14, 2023
@wbpcode wbpcode removed the help wanted Needs help! label Nov 14, 2023
@cwww3
Copy link

cwww3 commented Jan 10, 2024

has Dubbo trace supported now?

@wbpcode
Copy link
Member Author

wbpcode commented Jan 10, 2024

cc @cwww3 sorry, but I won't add new feature to dubbo_proxy for now because the limited free bandwidth.

IMO, it's recommend to use the new generic_proxy with dubbo codec to proxy dubbo traffic. And it provide full featured tracing, logging, and stats support.

See https://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/generic_proxy_filter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dubbo area/tracing enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

No branches or pull requests

5 participants