OpenTelemetryのトレースシグナル取得をする上で、ユーザーの属性に応じてサンプリングを調整したいことがある。たとえば以下のような具合だ。 userType=freeの場合は1%サンプリング(1%拾い、99%は廃棄) standardなどほかのuserTypeの場合は全サンプリング(全部拾う) テールサンプリングかな?と思うところだが、これは少々問題がある。 tail_sampling: decision_wait: 10s policies: - name: free_sampling type: and and: and_sub_policy: - name: match_free type: ottl_condition ottl_condition: span: - attributes["userType"] == "free" - name: probabilistic
