Merge pull request #1 from bilibili/master

merge from bilibili
pull/256/head
wuxingzhong 5 years ago committed by GitHub
commit 119b8f18eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 51
      doc/wiki-cn/warden-resolver.md
  2. 71
      go.mod
  3. 274
      go.sum
  4. 5
      pkg/cache/memcache/errors.go
  5. 51
      pkg/cache/memcache/metrics.go
  6. 33
      pkg/cache/memcache/pool_conn.go
  7. 22
      pkg/cache/metrics.go
  8. 32
      pkg/cache/redis/conn.go
  9. 5
      pkg/cache/redis/errors.go
  10. 51
      pkg/cache/redis/metrics.go
  11. 26
      pkg/cache/redis/pool.go
  12. 2
      pkg/database/hbase/hbase.go
  13. 39
      pkg/database/hbase/metrics.go
  14. 37
      pkg/database/sql/metrics.go
  15. 3
      pkg/database/sql/mysql.go
  16. 38
      pkg/database/sql/sql.go
  17. 37
      pkg/database/tidb/metrics.go
  18. 38
      pkg/database/tidb/sql.go
  19. 3
      pkg/database/tidb/tidb.go
  20. 10
      pkg/log/log.go
  21. 1
      pkg/naming/discovery/discovery.go
  22. 324
      pkg/naming/etcd/etcd.go
  23. 99
      pkg/naming/etcd/etcd_test.go
  24. 8
      pkg/net/http/blademaster/client.go
  25. 4
      pkg/net/http/blademaster/logger.go
  26. 2
      pkg/net/http/blademaster/metadata.go
  27. 48
      pkg/net/http/blademaster/metrics.go
  28. 11
      pkg/net/http/blademaster/ratelimit.go
  29. 10
      pkg/net/http/blademaster/server.go
  30. 3
      pkg/net/metadata/key.go
  31. 22
      pkg/net/netutil/breaker/sre_breaker.go
  32. 16
      pkg/net/netutil/breaker/sre_breaker_test.go
  33. 9
      pkg/net/rpc/warden/client.go
  34. 14
      pkg/net/rpc/warden/logging.go
  35. 41
      pkg/net/rpc/warden/metrics.go
  36. 17
      pkg/net/rpc/warden/ratelimiter/ratelimiter.go
  37. 1
      pkg/net/rpc/warden/server.go
  38. 6
      pkg/net/trace/span.go
  39. 5
      pkg/net/trace/zipkin/zipkin.go
  40. 48
      pkg/stat/metric/counter.go
  41. 29
      pkg/stat/metric/counter_test.go
  42. 59
      pkg/stat/metric/gauge.go
  43. 50
      pkg/stat/metric/histogram.go
  44. 68
      pkg/stat/metric/metric.go
  45. 5
      pkg/stat/prom/README.md
  46. 163
      pkg/stat/prom/prometheus.go
  47. 25
      pkg/stat/stat.go
  48. 6
      pkg/sync/pipeline/fanout/fanout.go
  49. 15
      pkg/sync/pipeline/fanout/metrics.go
  50. 21
      third_party/google/ads/googleads/README.md
  51. 276
      third_party/google/ads/googleads/base.yaml
  52. 63
      third_party/google/ads/googleads/v1/common/ad_asset.proto
  53. 571
      third_party/google/ads/googleads/v1/common/ad_type_infos.proto
  54. 82
      third_party/google/ads/googleads/v1/common/asset_types.proto
  55. 232
      third_party/google/ads/googleads/v1/common/bidding.proto
  56. 50
      third_party/google/ads/googleads/v1/common/click_location.proto
  57. 594
      third_party/google/ads/googleads/v1/common/criteria.proto
  58. 84
      third_party/google/ads/googleads/v1/common/criterion_category_availability.proto
  59. 42
      third_party/google/ads/googleads/v1/common/custom_parameter.proto
  60. 41
      third_party/google/ads/googleads/v1/common/dates.proto
  61. 40
      third_party/google/ads/googleads/v1/common/explorer_auto_optimizer_setting.proto
  62. 344
      third_party/google/ads/googleads/v1/common/extensions.proto
  63. 41
      third_party/google/ads/googleads/v1/common/feed_common.proto
  64. 48
      third_party/google/ads/googleads/v1/common/final_app_url.proto
  65. 63
      third_party/google/ads/googleads/v1/common/frequency_cap.proto
  66. 42
      third_party/google/ads/googleads/v1/common/keyword_plan_common.proto
  67. 128
      third_party/google/ads/googleads/v1/common/matching_function.proto
  68. 527
      third_party/google/ads/googleads/v1/common/metrics.proto
  69. 217
      third_party/google/ads/googleads/v1/common/policy.proto
  70. 39
      third_party/google/ads/googleads/v1/common/real_time_bidding_setting.proto
  71. 294
      third_party/google/ads/googleads/v1/common/segments.proto
  72. 124
      third_party/google/ads/googleads/v1/common/simulation.proto
  73. 52
      third_party/google/ads/googleads/v1/common/tag_snippet.proto
  74. 57
      third_party/google/ads/googleads/v1/common/targeting_setting.proto
  75. 42
      third_party/google/ads/googleads/v1/common/text_label.proto
  76. 47
      third_party/google/ads/googleads/v1/common/url_collection.proto
  77. 293
      third_party/google/ads/googleads/v1/common/user_lists.proto
  78. 52
      third_party/google/ads/googleads/v1/common/value.proto
  79. 58
      third_party/google/ads/googleads/v1/enums/access_reason.proto
  80. 64
      third_party/google/ads/googleads/v1/enums/account_budget_proposal_status.proto
  81. 57
      third_party/google/ads/googleads/v1/enums/account_budget_proposal_type.proto
  82. 54
      third_party/google/ads/googleads/v1/enums/account_budget_status.proto
  83. 57
      third_party/google/ads/googleads/v1/enums/ad_customizer_placeholder_field.proto
  84. 54
      third_party/google/ads/googleads/v1/enums/ad_group_ad_rotation_mode.proto
  85. 56
      third_party/google/ads/googleads/v1/enums/ad_group_ad_status.proto
  86. 57
      third_party/google/ads/googleads/v1/enums/ad_group_criterion_approval_status.proto
  87. 56
      third_party/google/ads/googleads/v1/enums/ad_group_criterion_status.proto
  88. 56
      third_party/google/ads/googleads/v1/enums/ad_group_status.proto
  89. 82
      third_party/google/ads/googleads/v1/enums/ad_group_type.proto
  90. 63
      third_party/google/ads/googleads/v1/enums/ad_network_type.proto
  91. 65
      third_party/google/ads/googleads/v1/enums/ad_serving_optimization_status.proto
  92. 63
      third_party/google/ads/googleads/v1/enums/ad_strength.proto
  93. 102
      third_party/google/ads/googleads/v1/enums/ad_type.proto
  94. 85
      third_party/google/ads/googleads/v1/enums/advertising_channel_sub_type.proto
  95. 65
      third_party/google/ads/googleads/v1/enums/advertising_channel_type.proto
  96. 49
      third_party/google/ads/googleads/v1/enums/affiliate_location_feed_relationship_type.proto
  97. 78
      third_party/google/ads/googleads/v1/enums/affiliate_location_placeholder_field.proto
  98. 66
      third_party/google/ads/googleads/v1/enums/age_range_type.proto
  99. 51
      third_party/google/ads/googleads/v1/enums/app_campaign_app_store.proto
  100. 65
      third_party/google/ads/googleads/v1/enums/app_campaign_bidding_strategy_goal_type.proto
  101. Some files were not shown because too many files have changed in this diff Show More

@ -192,9 +192,60 @@ if err != nil {
// 特别注意!!!
// cancel必须在进程退出时执行!!!
cancel()
```
# 使用ETCD
和使用discovery类似,只需要在注册时使用etcd naming即可。
```go
package dao
import (
"context"
"github.com/bilibili/kratos/pkg/naming/etcd"
"github.com/bilibili/kratos/pkg/net/rpc/warden"
"github.com/bilibili/kratos/pkg/net/rpc/warden/resolver"
"google.golang.org/grpc"
)
// AppID your appid, ensure unique.
const AppID = "demo.service" // NOTE: example
func init(){
// NOTE: 注意这段代码,表示要使用etcd进行服务发现 ,其他事项参考discovery的说明
// NOTE: 在启动应用时,可以通过flag(-etcd.endpoints) 或者 环境配置(ETCD_ENDPOINTS)指定etcd节点
// NOTE: 如果需要自己指定配置时 需要同时设置DialTimeout 与 DialOptions: []grpc.DialOption{grpc.WithBlock()}
resolver.Register(etcd.Builder(nil))
}
// NewClient new member grpc client
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (DemoClient, error) {
client := warden.NewClient(cfg, opts...)
// 这里使用etcd scheme
conn, err := client.Dial(context.Background(), "etcd://default/"+AppID)
if err != nil {
return nil, err
}
// 注意替换这里:
// NewDemoClient方法是在"api"目录下代码生成的
// 对应proto文件内自定义的service名字,请使用正确方法名替换
return NewDemoClient(conn), nil
}
```
etcd的服务注册与discovery基本相同,可以传入详细的etcd配置项, 或者传入nil后通过flag(-etcd.endpoints)/环境配置(ETCD_ENDPOINTS)来指定etcd节点。
### 其他配置项
etcd默认的全局keyPrefix为kratos_etcd,当该keyPrefix与项目中其他keyPrefix冲突时可以通过flag(-etcd.prefix)或者环境配置(ETCD_PREFIX)来指定keyPrefix。
# 扩展阅读
[warden快速开始](warden-quickstart.md) [warden拦截器](warden-mid.md) [warden基于pb生成](warden-pb.md) [warden负载均衡](warden-balancer.md)

@ -3,69 +3,56 @@ module github.com/bilibili/kratos
go 1.12
require (
cloud.google.com/go v0.41.0 // indirect
github.com/BurntSushi/toml v0.3.1
github.com/aristanetworks/goarista v0.0.0-20190409234242-46f4bc7b73ef // indirect
github.com/StackExchange/wmi v0.0.0-20190523213609-cbe66965904d // indirect
github.com/aristanetworks/goarista v0.0.0-20190712234253-ed1100a1c015 // indirect
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d // indirect
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
github.com/cznic/strutil v0.0.0-20181122101858-275e90344537 // indirect
github.com/dgryski/go-farm v0.0.0-20190323231341-8198c7b169ec
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2
github.com/fatih/color v1.7.0
github.com/fsnotify/fsnotify v1.4.7
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-playground/locales v0.12.1 // indirect
github.com/go-playground/universal-translator v0.16.0 // indirect
github.com/go-sql-driver/mysql v1.4.1
github.com/gogo/protobuf v1.2.0
github.com/gogo/protobuf v1.2.1
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/mock v1.3.1 // indirect
github.com/golang/protobuf v1.3.1
github.com/kr/pty v1.1.8 // indirect
github.com/golang/protobuf v1.3.2
github.com/google/btree v1.0.0 // indirect
github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.9.4 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/leodido/go-urn v1.1.0 // indirect
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/montanaflynn/stats v0.5.0
github.com/openzipkin/zipkin-go v0.2.0
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.2
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
github.com/prometheus/client_golang v1.0.0
github.com/prometheus/client_model v0.0.0-20190220174349-fd36f4220a90 // indirect
github.com/prometheus/common v0.6.0 // indirect
github.com/prometheus/procfs v0.0.3 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20190806203942-babf20351dd7e3ac320adedbbe5eb311aec8763c // indirect
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec // indirect
github.com/shirou/gopsutil v2.18.12+incompatible
github.com/shirou/gopsutil v2.19.6+incompatible
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726
github.com/sirupsen/logrus v1.4.1
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.3.0
github.com/tsuna/gohbase v0.0.0-20190201102810-d3184c1526df
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/tsuna/gohbase v0.0.0-20190502052937-24ffed0537aa
github.com/urfave/cli v1.20.0
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 // indirect
golang.org/x/lint v0.0.0-20190511005446-959b441ac422 // indirect
golang.org/x/mod v0.1.0 // indirect
go.etcd.io/etcd v0.0.0-20190720005121-fe86a786a4c3
go.uber.org/atomic v1.4.0 // indirect
go.uber.org/zap v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/net v0.0.0-20190628185345-da137c7871d7
golang.org/x/oauth2 v0.0.0-20190614102709-0f29369cfe45 // indirect
golang.org/x/sync v0.0.0-20190427212804-112230192c58 // indirect
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468 // indirect
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect
golang.org/x/time v0.0.0-20190513212739-9d24e82272b4 // indirect
google.golang.org/appengine v1.6.1 // indirect
google.golang.org/genproto v0.0.0-20190701230453-710ae3a149df
google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610
google.golang.org/grpc v1.22.0
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v9 v9.26.0
gopkg.in/go-playground/validator.v9 v9.29.1
gopkg.in/yaml.v2 v2.2.2
honnef.co/go/tools v0.0.0-20190605142022-0a11fc526260 // indirect
)
replace (
cloud.google.com/go => github.com/googleapis/google-cloud-go v0.26.0
golang.org/x/crypto => github.com/golang/crypto v0.0.0-20190123085648-057139ce5d2b
golang.org/x/lint => github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3
golang.org/x/net => github.com/golang/net v0.0.0-20190311183353-d8887717615a
golang.org/x/oauth2 => github.com/golang/oauth2 v0.0.0-20180821212333-d2e6202438be
golang.org/x/sync => github.com/golang/sync v0.0.0-20181108010431-42b317875d0f
golang.org/x/sys => github.com/golang/sys v0.0.0-20180905080454-ebe1bf3edb33
golang.org/x/text => github.com/golang/text v0.3.0
golang.org/x/time => github.com/golang/time v0.0.0-20190308202827-9d24e82272b4
golang.org/x/tools => github.com/golang/tools v0.0.0-20190328211700-ab21143f2384
google.golang.org/appengine => github.com/golang/appengine v1.1.0
google.golang.org/genproto => github.com/google/go-genproto v0.0.0-20180817151627-c66870c02cf8
google.golang.org/grpc => github.com/grpc/grpc-go v1.20.1
)

274
go.sum

@ -1,13 +1,29 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/aristanetworks/goarista v0.0.0-20190409234242-46f4bc7b73ef h1:ajsnF5qTstiBlP+V/mgh91zZfoKP477KfSmRoCoyYGU=
github.com/aristanetworks/goarista v0.0.0-20190409234242-46f4bc7b73ef/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/StackExchange/wmi v0.0.0-20190523213609-cbe66965904d h1:VWP4o43LuzNbykZJzMUv5b9DWLgn0sn3GUj3RUyWMMQ=
github.com/StackExchange/wmi v0.0.0-20190523213609-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/aristanetworks/goarista v0.0.0-20190712234253-ed1100a1c015 h1:7ABPr1+uJdqESAdlVevnc/2FJGiC/K3uMg1JiELeF+0=
github.com/aristanetworks/goarista v0.0.0-20190712234253-ed1100a1c015/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/cockroachdb/datadriven v0.0.0-20190531201743-edce55837238 h1:uNljlOxtOHrPnRoPPx+JanqjAGZpNiqAGVBfGskd/pg=
github.com/cockroachdb/datadriven v0.0.0-20190531201743-edce55837238/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 h1:u9SHYsPQNyt5tgDm3YN7+9dYrpK96E5wFilTFWIDZOM=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d h1:SwD98825d6bdB+pEuTxWOXiSjBrHdOl/UVp75eI7JT8=
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8=
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 h1:iwZdTE0PVqJCos1vaoKsclOGD3ADKpshg3SRtYBbwso=
@ -18,132 +34,284 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgryski/go-farm v0.0.0-20190323231341-8198c7b169ec h1:sElGDs3V8VdCxH5tWi0ycWJzteOPLJ3HtItSSKI95PY=
github.com/dgryski/go-farm v0.0.0-20190323231341-8198c7b169ec/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 h1:qk/FSDDxo05wdJH28W+p5yivv7LuLYLRXPPD8KQCtZs=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc=
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM=
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/appengine v1.1.0 h1:i5Me8ymxZ0UcvrKKqVyk7iemYgabJFc19gXizKBaTa0=
github.com/golang/appengine v1.1.0/go.mod h1:C7k13PpLjU5SHb7WgwfAwCmVFgi4cpy3kl2zlpoBck8=
github.com/golang/crypto v0.0.0-20190123085648-057139ce5d2b h1:9dkUhGlF9C+jJBMDKqq91ycBLyQMvFjTdBhOqchi7lU=
github.com/golang/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:uZvAcrsnNaCxlh1HorK5dUQHGmEKPh2H/Rl1kehswPo=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/net v0.0.0-20190311183353-d8887717615a h1:4V+LPwzBFLRg7XSXZw133Jsur1mTVMY73hIv/FTdrbg=
github.com/golang/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
github.com/golang/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:ovBFgdmJqyggKzXS0i5+osE+RsPEbEsUfp2sVCgys1Q=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/sync v0.0.0-20181108010431-42b317875d0f h1:vuwODIDRvDgwjIl6VTMf0c1Z9uVMUUxiu6UPUjiGhD4=
github.com/golang/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:YCHYtYb9c8Q7XgYVYjmJBPtFPKx5QvOcPxHZWjldabE=
github.com/golang/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:GJexUf2QgFNvMR9sjJ1iqs+2TxZqJko+Muhnu04tPuU=
github.com/golang/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:5JyrLPvD/ZdaYkT7IqKhsP5xt7aLjA99KXRtk4EIYDk=
github.com/golang/text v0.3.0 h1:uI5zIUA9cg047ctlTptnVc0Ghjfurf2eZMFrod8R7v8=
github.com/golang/text v0.3.0/go.mod h1:GUiq9pdJKRKKAZXiVgWFEvocYuREvC14NhI4OPgEjeE=
github.com/golang/time v0.0.0-20190308202827-9d24e82272b4 h1:F9e5QAps6/3zc8881JhdfJBCj+KjFaahs4YNEzAPc/Q=
github.com/golang/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
github.com/golang/tools v0.0.0-20190328211700-ab21143f2384 h1:8J6Yq2enLsHiOXruypwvT3wf8eAvi7wRmS5KCt7RbHo=
github.com/golang/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
github.com/google/go-genproto v0.0.0-20180817151627-c66870c02cf8 h1:I9PuChzQA31gMw88WmVPJaAwE0nZNHpMrLDUnTyzFAI=
github.com/google/go-genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:3Rcd9jSoLVkV/osPrt5CogLvLiarfI8U9/x78NwhuDU=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/googleapis/google-cloud-go v0.26.0/go.mod h1:yJoOdPPE9UpqbamBhJvp7Ur6OUPPV4rUY3RnssPGNBA=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/grpc/grpc-go v1.20.1 h1:pk72GtSPpOdZDTkPneppDMGW10HYPC7RqNJT/JvUpV0=
github.com/grpc/grpc-go v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.4.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.9.4 h1:5xLhQjsk4zqPf9EHCrja2qFZMx+yBqkO3XgJ14bNnU0=
github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.0.0/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8=
github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.0/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/montanaflynn/stats v0.5.0 h1:2EkzeTSqBB4V4bJwWrt5gIIrZmpJBcoIRGS2kWLgzmk=
github.com/montanaflynn/stats v0.5.0/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/openzipkin/zipkin-go v0.2.0 h1:33/f6xXB6YlOQ9tgTsXVOkdLCJsHTcZJnMy4DnSd6FU=
github.com/openzipkin/zipkin-go v0.2.0/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740=
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 h1:PnBWHBf+6L0jOqq0gIVUe6Yk0/QMZ640k6NvkxcBf+8=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a h1:9a8MnZMP0X2nLJdBg+pBmGgkJlSaKC2KaQmTCk1XDtE=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190220174349-fd36f4220a90 h1:Cov9QkEXNhh8QeXoICvORjJ4RrpyvXmSf7rHSpS+ZfI=
github.com/prometheus/client_model v0.0.0-20190220174349-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20180518154759-7600349dcfe1/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/procfs v0.0.0-20180612222113-7d6f385de8be/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 h1:YDeskXpkNDhPdWN3REluVa46HQOVuVkjkd2sWnrABNQ=
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/remyoudompheng/bigfft v0.0.0-20190806203942-babf20351dd7e3ac320adedbbe5eb311aec8763c h1:eED6LswgZ3TfAl9fb+L2TfdSlXpYdg21iWZMdHuoSks=
github.com/remyoudompheng/bigfft v0.0.0-20190806203942-babf20351dd7e3ac320adedbbe5eb311aec8763c/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec h1:6ncX5ko6B9LntYM0YBRXkiSaZMmLYeZ/NWcmeB43mMY=
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM=
github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v2.19.6+incompatible h1:49/Gru26Lne9Cl3IoAVDZVM09hvkSrUodgIIsCVRwbs=
github.com/shirou/gopsutil v2.19.6+incompatible/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM=
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/tsuna/gohbase v0.0.0-20190201102810-d3184c1526df h1:jYiwqXfoRWU6pJMzClEpLn9Jofi3U/8qS+w3iRNJ/hw=
github.com/tsuna/gohbase v0.0.0-20190201102810-d3184c1526df/go.mod h1:3HfLQly3YNLGxNv/2YOfmz30vcjG9hbuME1GpxoLlGs=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tsuna/gohbase v0.0.0-20190502052937-24ffed0537aa h1:V/ABqiqsgqmpoIcLDSpJ1KqPfbxRmkcfET5+BRy9ctM=
github.com/tsuna/gohbase v0.0.0-20190502052937-24ffed0537aa/go.mod h1:3HfLQly3YNLGxNv/2YOfmz30vcjG9hbuME1GpxoLlGs=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/etcd v0.0.0-20190720005121-fe86a786a4c3 h1:LlCFU/KJ9P/8QKB73kkd1z/zbm7ZJ2V4HEgEHI3N7gk=
go.etcd.io/etcd v0.0.0-20190720005121-fe86a786a4c3/go.mod h1:N0RPWo9FXJYZQI4BTkDtQylrstIigYHeR18ONnyTufk=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180608092829-8ac0e0d97ce4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 h1:LepdCS8Gf/MVejFIt8lsiexZATdoGVyp5bcyS+rYoUI=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190513212739-9d24e82272b4 h1:RMGusaKverhgGR5KBERIKiTyWoWHRd84GCtsNlvLvIo=
golang.org/x/time v0.0.0-20190513212739-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/genproto v0.0.0-20180608181217-32ee49c4dd80/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610 h1:Ygq9/SRJX9+dU0WCIICM8RkWvDw03lvB77hrhJnpxfU=
google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw=
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v9 v9.26.0 h1:2NPPsBpD0ZoxshmLWewQru8rWmbT5JqSzz9D1ZrAjYQ=
gopkg.in/go-playground/validator.v9 v9.26.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc=
gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190605142022-0a11fc526260/go.mod h1:JlmFZigtG9vBVR3QGIQ9g/Usz4BzH+Xm6Z8iHQWRYUw=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

@ -49,10 +49,13 @@ func (pe protocolError) Error() string {
return fmt.Sprintf("memcache: %s (possible server error or unsupported concurrent read by application)", string(pe))
}
func formatErr(err error) string {
func (pc *poolConn) formatErr(err error) string {
e := pkgerr.Cause(err)
switch e {
case ErrNotFound, ErrExists, ErrNotStored, nil:
if e == ErrNotFound {
_metricMisses.Inc(pc.p.c.Name, pc.p.c.Addr)
}
return ""
default:
es := e.Error()

@ -0,0 +1,51 @@
package memcache
import "github.com/bilibili/kratos/pkg/stat/metric"
const namespace = "memcache_client"
var (
_metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "memcache client requests duration(ms).",
Labels: []string{"name", "addr", "command"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500},
})
_metricReqErr = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "error_total",
Help: "memcache client requests error count.",
Labels: []string{"name", "addr", "command", "error"},
})
_metricConnTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "total",
Help: "memcache client connections total count.",
Labels: []string{"name", "addr", "state"},
})
_metricConnCurrent = metric.NewGaugeVec(&metric.GaugeVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "current",
Help: "memcache client connections current.",
Labels: []string{"name", "addr", "state"},
})
_metricHits = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "",
Name: "hits_total",
Help: "memcache client hits total.",
Labels: []string{"name", "addr"},
})
_metricMisses = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "",
Name: "misses_total",
Help: "memcache client misses total.",
Labels: []string{"name", "addr"},
})
)

@ -7,11 +7,8 @@ import (
"time"
"github.com/bilibili/kratos/pkg/container/pool"
"github.com/bilibili/kratos/pkg/stat"
)
var stats = stat.Cache
// Pool memcache connection pool struct.
// Deprecated: Use Memcache instead
type Pool struct {
@ -62,13 +59,15 @@ type poolConn struct {
ctx context.Context
}
func pstat(key string, t time.Time, err error) {
stats.Timing(key, int64(time.Since(t)/time.Millisecond))
func (pc *poolConn) pstat(key string, t time.Time, err error) {
_metricReqDur.Observe(int64(time.Since(t)/time.Millisecond), pc.p.c.Name, pc.p.c.Addr, key)
if err != nil {
if msg := formatErr(err); msg != "" {
stats.Incr("memcache", msg)
if msg := pc.formatErr(err); msg != "" {
_metricReqErr.Inc(pc.p.c.Name, pc.p.c.Addr, key, msg)
}
return
}
_metricHits.Inc(pc.p.c.Name, pc.p.c.Addr)
}
func (pc *poolConn) Close() error {
@ -132,28 +131,28 @@ func (pc *poolConn) Decrement(key string, delta uint64) (newValue uint64, err er
func (pc *poolConn) AddContext(ctx context.Context, item *Item) error {
now := time.Now()
err := pc.c.AddContext(ctx, item)
pstat("memcache:add", now, err)
pc.pstat("add", now, err)
return err
}
func (pc *poolConn) SetContext(ctx context.Context, item *Item) error {
now := time.Now()
err := pc.c.SetContext(ctx, item)
pstat("memcache:set", now, err)
pc.pstat("set", now, err)
return err
}
func (pc *poolConn) ReplaceContext(ctx context.Context, item *Item) error {
now := time.Now()
err := pc.c.ReplaceContext(ctx, item)
pstat("memcache:replace", now, err)
pc.pstat("replace", now, err)
return err
}
func (pc *poolConn) GetContext(ctx context.Context, key string) (*Item, error) {
now := time.Now()
item, err := pc.c.Get(key)
pstat("memcache:get", now, err)
pc.pstat("get", now, err)
return item, err
}
@ -164,41 +163,41 @@ func (pc *poolConn) GetMultiContext(ctx context.Context, keys []string) (map[str
}
now := time.Now()
items, err := pc.c.GetMulti(keys)
pstat("memcache:gets", now, err)
pc.pstat("gets", now, err)
return items, err
}
func (pc *poolConn) DeleteContext(ctx context.Context, key string) error {
now := time.Now()
err := pc.c.Delete(key)
pstat("memcache:delete", now, err)
pc.pstat("delete", now, err)
return err
}
func (pc *poolConn) IncrementContext(ctx context.Context, key string, delta uint64) (uint64, error) {
now := time.Now()
newValue, err := pc.c.IncrementContext(ctx, key, delta)
pstat("memcache:increment", now, err)
pc.pstat("increment", now, err)
return newValue, err
}
func (pc *poolConn) DecrementContext(ctx context.Context, key string, delta uint64) (uint64, error) {
now := time.Now()
newValue, err := pc.c.DecrementContext(ctx, key, delta)
pstat("memcache:decrement", now, err)
pc.pstat("decrement", now, err)
return newValue, err
}
func (pc *poolConn) CompareAndSwapContext(ctx context.Context, item *Item) error {
now := time.Now()
err := pc.c.CompareAndSwap(item)
pstat("memcache:cas", now, err)
pc.pstat("cas", now, err)
return err
}
func (pc *poolConn) TouchContext(ctx context.Context, key string, seconds int32) error {
now := time.Now()
err := pc.c.Touch(key, seconds)
pstat("memcache:touch", now, err)
pc.pstat("touch", now, err)
return err
}

@ -0,0 +1,22 @@
package cache
import "github.com/bilibili/kratos/pkg/stat/metric"
const _metricNamespace = "cache"
var (
MetricHits = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: _metricNamespace,
Subsystem: "",
Name: "hits_total",
Help: "cache hits total.",
Labels: []string{"name"},
})
MetricMisses = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: _metricNamespace,
Subsystem: "",
Name: "misses_total",
Help: "cache misses total.",
Labels: []string{"name"},
})
)

@ -27,16 +27,11 @@ import (
"sync"
"time"
"github.com/bilibili/kratos/pkg/stat"
"github.com/pkg/errors"
)
var stats = stat.Cache
// conn is the low-level implementation of Conn
type conn struct {
// Shared
mu sync.Mutex
pending int
@ -57,20 +52,6 @@ type conn struct {
// Scratch space for formatting integers and floats.
numScratch [40]byte
// stat func,default prom
stat func(string, *error) func()
}
func statfunc(cmd string, err *error) func() {
now := time.Now()
return func() {
stats.Timing(fmt.Sprintf("redis:%s", cmd), int64(time.Since(now)/time.Millisecond))
if err != nil {
if msg := formatErr(*err); msg != "" {
stats.Incr("redis", msg)
}
}
}
}
// DialTimeout acts like Dial but takes timeouts for establishing the
@ -95,14 +76,6 @@ type dialOptions struct {
dial func(network, addr string) (net.Conn, error)
db int
password string
stat func(string, *error) func()
}
// DialStats specifies stat func for stats.default statfunc.
func DialStats(fn func(string, *error) func()) DialOption {
return DialOption{func(do *dialOptions) {
do.stat = fn
}}
}
// DialReadTimeout specifies the timeout for reading a single command reply.
@ -171,7 +144,6 @@ func Dial(network, address string, options ...DialOption) (Conn, error) {
br: bufio.NewReader(netConn),
readTimeout: do.readTimeout,
writeTimeout: do.writeTimeout,
stat: statfunc,
}
if do.password != "" {
@ -187,9 +159,6 @@ func Dial(network, address string, options ...DialOption) (Conn, error) {
return nil, errors.WithStack(err)
}
}
if do.stat != nil {
c.stat = do.stat
}
return c, nil
}
@ -551,7 +520,6 @@ func (c *conn) Do(cmd string, args ...interface{}) (interface{}, error) {
return nil, nil
}
var err error
defer c.stat(cmd, &err)()
if cmd != "" {
err = c.writeCommand(cmd, args)
}

@ -6,10 +6,13 @@ import (
pkgerr "github.com/pkg/errors"
)
func formatErr(err error) string {
func formatErr(err error, name, addr string) string {
e := pkgerr.Cause(err)
switch e {
case ErrNil, nil:
if e == ErrNil {
_metricMisses.Inc(name, addr)
}
return ""
default:
es := e.Error()

@ -0,0 +1,51 @@
package redis
import "github.com/bilibili/kratos/pkg/stat/metric"
const namespace = "redis_client"
var (
_metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "redis client requests duration(ms).",
Labels: []string{"name", "addr", "command"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500},
})
_metricReqErr = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "error_total",
Help: "redis client requests error count.",
Labels: []string{"name", "addr", "command", "error"},
})
_metricConnTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "total",
Help: "redis client connections total count.",
Labels: []string{"name", "addr", "state"},
})
_metricConnCurrent = metric.NewGaugeVec(&metric.GaugeVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "current",
Help: "redis client connections current.",
Labels: []string{"name", "addr", "state"},
})
_metricHits = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "",
Name: "hits_total",
Help: "redis client hits total.",
Labels: []string{"name", "addr"},
})
_metricMisses = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "",
Name: "misses_total",
Help: "redis client misses total.",
Labels: []string{"name", "addr"},
})
)

@ -41,6 +41,8 @@ type Pool struct {
*pool.Slice
// config
c *Config
// statfunc
statfunc func(name, addr, cmd string, t time.Time, err error) func()
}
// Config client settings.
@ -76,7 +78,7 @@ func NewPool(c *Config, options ...DialOption) (p *Pool) {
}
return &traceConn{Conn: conn, connTags: []trace.Tag{trace.TagString(trace.TagPeerAddress, c.Addr)}}, nil
}
p = &Pool{Slice: p1, c: c}
p = &Pool{Slice: p1, c: c, statfunc: pstat}
return
}
@ -126,6 +128,24 @@ func initSentinel() {
}
}
// SetStatFunc set stat func.
func (p *Pool) SetStatFunc(fn func(name, addr, cmd string, t time.Time, err error) func()) {
p.statfunc = fn
}
func pstat(name, addr, cmd string, t time.Time, err error) func() {
return func() {
_metricReqDur.Observe(int64(time.Since(t)/time.Millisecond), name, addr, cmd)
if err != nil {
if msg := formatErr(err, name, addr); msg != "" {
_metricReqErr.Inc(name, addr, cmd, msg)
}
return
}
_metricHits.Inc(name, addr)
}
}
func (pc *pooledConnection) Close() error {
c := pc.c
if _, ok := c.(errorConnection); ok {
@ -169,9 +189,11 @@ func (pc *pooledConnection) Err() error {
}
func (pc *pooledConnection) Do(commandName string, args ...interface{}) (reply interface{}, err error) {
now := time.Now()
ci := LookupCommandInfo(commandName)
pc.state = (pc.state | ci.Set) &^ ci.Clear
reply, err = pc.c.Do(commandName, args...)
pc.p.statfunc(pc.p.c.Name, pc.p.c.Addr, commandName, now, err)()
return
}
@ -193,7 +215,9 @@ func (pc *pooledConnection) Flush() error {
func (pc *pooledConnection) Receive() (reply interface{}, err error) {
reply, err = pc.c.Receive()
if len(pc.cmds) > 0 {
cmd := pc.cmds[0]
pc.cmds = pc.cmds[1:]
pc.p.statfunc(pc.p.c.Name, pc.p.c.Addr, cmd, pc.now, err)()
}
return
}

@ -44,7 +44,7 @@ func (c *Client) invokeHook(ctx context.Context, call hrpc.Call, customName stri
func NewClient(config *Config, options ...gohbase.Option) *Client {
rawcli := NewRawClient(config, options...)
rawcli.AddHook(NewSlowLogHook(250 * time.Millisecond))
rawcli.AddHook(MetricsHook(nil))
rawcli.AddHook(MetricsHook(config))
rawcli.AddHook(TraceHook("database/hbase", strings.Join(config.Zookeeper.Addrs, ",")))
return rawcli
}

@ -3,12 +3,33 @@ package hbase
import (
"context"
"io"
"strings"
"time"
"github.com/tsuna/gohbase"
"github.com/tsuna/gohbase/hrpc"
"github.com/bilibili/kratos/pkg/stat"
"github.com/bilibili/kratos/pkg/stat/metric"
)
const namespace = "hbase_client"
var (
_metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "hbase client requests duration(ms).",
Labels: []string{"name", "addr", "command"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500},
})
_metricReqErr = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "error_total",
Help: "mysql client requests error count.",
Labels: []string{"name", "addr", "command", "error"},
})
)
func codeFromErr(err error) string {
@ -16,32 +37,28 @@ func codeFromErr(err error) string {
switch err {
case gohbase.ErrClientClosed:
code = "client_closed"
case gohbase.ErrConnotFindRegion:
case gohbase.ErrCannotFindRegion:
code = "connot_find_region"
case gohbase.TableNotFound:
code = "table_not_found"
case gohbase.ErrRegionUnavailable:
code = "region_unavailable"
//case gohbase.ErrRegionUnavailable:
// code = "region_unavailable"
}
return code
}
// MetricsHook if stats is nil use stat.DB as default.
func MetricsHook(stats stat.Stat) HookFunc {
if stats == nil {
stats = stat.DB
}
func MetricsHook(config *Config) HookFunc {
return func(ctx context.Context, call hrpc.Call, customName string) func(err error) {
now := time.Now()
if customName == "" {
customName = call.Name()
}
method := "hbase:" + customName
return func(err error) {
durationMs := int64(time.Since(now) / time.Millisecond)
stats.Timing(method, durationMs)
_metricReqDur.Observe(durationMs, strings.Join(config.Zookeeper.Addrs, ","), "", customName)
if err != nil && err != io.EOF {
stats.Incr(method, codeFromErr(err))
_metricReqErr.Inc(strings.Join(config.Zookeeper.Addrs, ","), "", customName, codeFromErr(err))
}
}
}

@ -0,0 +1,37 @@
package sql
import "github.com/bilibili/kratos/pkg/stat/metric"
const namespace = "mysql_client"
var (
_metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "mysql client requests duration(ms).",
Labels: []string{"name", "addr", "command"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500},
})
_metricReqErr = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "error_total",
Help: "mysql client requests error count.",
Labels: []string{"name", "addr", "command", "error"},
})
_metricConnTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "total",
Help: "mysql client connections total count.",
Labels: []string{"name", "addr", "state"},
})
_metricConnCurrent = metric.NewGaugeVec(&metric.GaugeVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "current",
Help: "mysql client connections current.",
Labels: []string{"name", "addr", "state"},
})
)

@ -3,15 +3,12 @@ package sql
import (
"github.com/bilibili/kratos/pkg/log"
"github.com/bilibili/kratos/pkg/net/netutil/breaker"
"github.com/bilibili/kratos/pkg/stat"
"github.com/bilibili/kratos/pkg/time"
// database driver
_ "github.com/go-sql-driver/mysql"
)
var stats = stat.DB
// Config mysql config.
type Config struct {
Addr string // for trace

@ -279,12 +279,12 @@ func (db *conn) begin(c context.Context) (tx *Tx, err error) {
}()
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("mysql:begin", "breaker")
_metricReqErr.Inc(db.conf.Addr, db.conf.Addr, "begin", "breaker")
return
}
_, c, cancel := db.conf.TranTimeout.Shrink(c)
rtx, err := db.BeginTx(c, nil)
stats.Timing("mysql:begin", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.conf.Addr, db.conf.Addr, "begin")
if err != nil {
err = errors.WithStack(err)
cancel()
@ -303,14 +303,14 @@ func (db *conn) exec(c context.Context, query string, args ...interface{}) (res
defer t.Finish(&err)
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("mysql:exec", "breaker")
_metricReqErr.Inc(db.conf.Addr, db.conf.Addr, "exec", "breaker")
return
}
_, c, cancel := db.conf.ExecTimeout.Shrink(c)
res, err = db.ExecContext(c, query, args...)
cancel()
db.onBreaker(&err)
stats.Timing("mysql:exec", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.conf.Addr, db.conf.Addr, "exec")
if err != nil {
err = errors.Wrapf(err, "exec:%s, args:%+v", query, args)
}
@ -326,14 +326,14 @@ func (db *conn) ping(c context.Context) (err error) {
defer t.Finish(&err)
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("mysql:ping", "breaker")
_metricReqErr.Inc(db.conf.Addr, db.conf.Addr, "ping", "breaker")
return
}
_, c, cancel := db.conf.ExecTimeout.Shrink(c)
err = db.PingContext(c)
cancel()
db.onBreaker(&err)
stats.Timing("mysql:ping", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.conf.Addr, db.conf.Addr, "ping")
if err != nil {
err = errors.WithStack(err)
}
@ -383,13 +383,13 @@ func (db *conn) query(c context.Context, query string, args ...interface{}) (row
defer t.Finish(&err)
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("mysql:query", "breaker")
_metricReqErr.Inc(db.conf.Addr, db.conf.Addr, "query", "breaker")
return
}
_, c, cancel := db.conf.QueryTimeout.Shrink(c)
rs, err := db.DB.QueryContext(c, query, args...)
db.onBreaker(&err)
stats.Timing("mysql:query", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.conf.Addr, db.conf.Addr, "query")
if err != nil {
err = errors.Wrapf(err, "query:%s, args:%+v", query, args)
cancel()
@ -408,12 +408,12 @@ func (db *conn) queryRow(c context.Context, query string, args ...interface{}) *
t.SetTag(trace.String(trace.TagAddress, db.conf.Addr), trace.String(trace.TagComment, query))
}
if err := db.breaker.Allow(); err != nil {
stats.Incr("mysql:queryrow", "breaker")
_metricReqErr.Inc(db.conf.Addr, db.conf.Addr, "queryRow", "breaker")
return &Row{db: db, t: t, err: err}
}
_, c, cancel := db.conf.QueryTimeout.Shrink(c)
r := db.DB.QueryRowContext(c, query, args...)
stats.Timing("mysql:queryrow", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.conf.Addr, db.conf.Addr, "queryrow")
return &Row{db: db, Row: r, query: query, args: args, t: t, cancel: cancel}
}
@ -449,7 +449,7 @@ func (s *Stmt) Exec(c context.Context, args ...interface{}) (res sql.Result, err
defer t.Finish(&err)
}
if err = s.db.breaker.Allow(); err != nil {
stats.Incr("mysql:stmt:exec", "breaker")
_metricReqErr.Inc(s.db.conf.Addr, s.db.conf.Addr, "stmt:exec", "breaker")
return
}
stmt, ok := s.stmt.Load().(*sql.Stmt)
@ -461,7 +461,7 @@ func (s *Stmt) Exec(c context.Context, args ...interface{}) (res sql.Result, err
res, err = stmt.ExecContext(c, args...)
cancel()
s.db.onBreaker(&err)
stats.Timing("mysql:stmt:exec", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), s.db.conf.Addr, s.db.conf.Addr, "stmt:exec")
if err != nil {
err = errors.Wrapf(err, "exec:%s, args:%+v", s.query, args)
}
@ -487,7 +487,7 @@ func (s *Stmt) Query(c context.Context, args ...interface{}) (rows *Rows, err er
defer t.Finish(&err)
}
if err = s.db.breaker.Allow(); err != nil {
stats.Incr("mysql:stmt:query", "breaker")
_metricReqErr.Inc(s.db.conf.Addr, s.db.conf.Addr, "stmt:query", "breaker")
return
}
stmt, ok := s.stmt.Load().(*sql.Stmt)
@ -498,7 +498,7 @@ func (s *Stmt) Query(c context.Context, args ...interface{}) (rows *Rows, err er
_, c, cancel := s.db.conf.QueryTimeout.Shrink(c)
rs, err := stmt.QueryContext(c, args...)
s.db.onBreaker(&err)
stats.Timing("mysql:stmt:query", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), s.db.conf.Addr, s.db.conf.Addr, "stmt:query")
if err != nil {
err = errors.Wrapf(err, "query:%s, args:%+v", s.query, args)
cancel()
@ -531,7 +531,7 @@ func (s *Stmt) QueryRow(c context.Context, args ...interface{}) (row *Row) {
row.t = t
}
if row.err = s.db.breaker.Allow(); row.err != nil {
stats.Incr("mysql:stmt:queryrow", "breaker")
_metricReqErr.Inc(s.db.conf.Addr, s.db.conf.Addr, "stmt:queryrow", "breaker")
return
}
stmt, ok := s.stmt.Load().(*sql.Stmt)
@ -541,7 +541,7 @@ func (s *Stmt) QueryRow(c context.Context, args ...interface{}) (row *Row) {
_, c, cancel := s.db.conf.QueryTimeout.Shrink(c)
row.Row = stmt.QueryRowContext(c, args...)
row.cancel = cancel
stats.Timing("mysql:stmt:queryrow", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), s.db.conf.Addr, s.db.conf.Addr, "stmt:queryrow")
return
}
@ -582,7 +582,7 @@ func (tx *Tx) Exec(query string, args ...interface{}) (res sql.Result, err error
tx.t.SetTag(trace.String(trace.TagAnnotation, fmt.Sprintf("exec %s", query)))
}
res, err = tx.tx.ExecContext(tx.c, query, args...)
stats.Timing("mysql:tx:exec", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), tx.db.conf.Addr, tx.db.conf.Addr, "tx:exec")
if err != nil {
err = errors.Wrapf(err, "exec:%s, args:%+v", query, args)
}
@ -597,7 +597,7 @@ func (tx *Tx) Query(query string, args ...interface{}) (rows *Rows, err error) {
now := time.Now()
defer slowLog(fmt.Sprintf("Query query(%s) args(%+v)", query, args), now)
defer func() {
stats.Timing("mysql:tx:query", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), tx.db.conf.Addr, tx.db.conf.Addr, "tx:query")
}()
rs, err := tx.tx.QueryContext(tx.c, query, args...)
if err == nil {
@ -618,7 +618,7 @@ func (tx *Tx) QueryRow(query string, args ...interface{}) *Row {
now := time.Now()
defer slowLog(fmt.Sprintf("QueryRow query(%s) args(%+v)", query, args), now)
defer func() {
stats.Timing("mysql:tx:queryrow", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), tx.db.conf.Addr, tx.db.conf.Addr, "tx:queryrow")
}()
r := tx.tx.QueryRowContext(tx.c, query, args...)
return &Row{Row: r, db: tx.db, query: query, args: args}

@ -0,0 +1,37 @@
package tidb
import "github.com/bilibili/kratos/pkg/stat/metric"
const namespace = "tidb_client"
var (
_metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "tidb client requests duration(ms).",
Labels: []string{"name", "addr", "command"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500},
})
_metricReqErr = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "requests",
Name: "error_total",
Help: "tidb client requests error count.",
Labels: []string{"name", "addr", "command", "error"},
})
_metricConnTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "total",
Help: "tidb client connections total count.",
Labels: []string{"name", "addr", "state"},
})
_metricConnCurrent = metric.NewGaugeVec(&metric.GaugeVecOpts{
Namespace: namespace,
Subsystem: "connections",
Name: "current",
Help: "tidb client connections current.",
Labels: []string{"name", "addr", "state"},
})
)

@ -291,12 +291,12 @@ func (db *conn) begin(c context.Context) (tx *Tx, err error) {
}()
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("tidb:begin", "breaker")
_metricReqErr.Inc(db.addr, db.addr, "begin", "breaker")
return
}
_, c, cancel := db.conf.TranTimeout.Shrink(c)
rtx, err := db.BeginTx(c, nil)
stats.Timing("tidb:begin", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.addr, db.addr, "begin")
if err != nil {
err = errors.WithStack(err)
cancel()
@ -315,14 +315,14 @@ func (db *conn) exec(c context.Context, query string, args ...interface{}) (res
defer t.Finish(&err)
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("tidb:exec", "breaker")
_metricReqErr.Inc(db.addr, db.addr, "exec", "breaker")
return
}
_, c, cancel := db.conf.ExecTimeout.Shrink(c)
res, err = db.ExecContext(c, query, args...)
cancel()
db.onBreaker(&err)
stats.Timing("tidb:exec", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.addr, db.addr, "exec")
if err != nil {
err = errors.Wrapf(err, "addr: %s exec:%s, args:%+v", db.addr, query, args)
}
@ -338,14 +338,14 @@ func (db *conn) ping(c context.Context) (err error) {
defer t.Finish(&err)
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("tidb:ping", "breaker")
_metricReqErr.Inc(db.addr, db.addr, "ping", "breaker")
return
}
_, c, cancel := db.conf.ExecTimeout.Shrink(c)
err = db.PingContext(c)
cancel()
db.onBreaker(&err)
stats.Timing("tidb:ping", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.addr, db.addr, "ping")
if err != nil {
err = errors.WithStack(err)
}
@ -384,13 +384,13 @@ func (db *conn) query(c context.Context, query string, args ...interface{}) (row
defer t.Finish(&err)
}
if err = db.breaker.Allow(); err != nil {
stats.Incr("tidb:query", "breaker")
_metricReqErr.Inc(db.addr, db.addr, "query", "breaker")
return
}
_, c, cancel := db.conf.QueryTimeout.Shrink(c)
rs, err := db.DB.QueryContext(c, query, args...)
db.onBreaker(&err)
stats.Timing("tidb:query", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.addr, db.addr, "query")
if err != nil {
err = errors.Wrapf(err, "addr: %s, query:%s, args:%+v", db.addr, query, args)
cancel()
@ -409,12 +409,12 @@ func (db *conn) queryRow(c context.Context, query string, args ...interface{}) *
t.SetTag(trace.String(trace.TagAddress, db.addr), trace.String(trace.TagComment, query))
}
if err := db.breaker.Allow(); err != nil {
stats.Incr("tidb:queryrow", "breaker")
_metricReqErr.Inc(db.addr, db.addr, "queryrow", "breaker")
return &Row{db: db, t: t, err: err}
}
_, c, cancel := db.conf.QueryTimeout.Shrink(c)
r := db.DB.QueryRowContext(c, query, args...)
stats.Timing("tidb:queryrow", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), db.addr, db.addr, "queryrow")
return &Row{db: db, Row: r, query: query, args: args, t: t, cancel: cancel}
}
@ -454,7 +454,7 @@ func (s *Stmt) Exec(c context.Context, args ...interface{}) (res sql.Result, err
defer t.Finish(&err)
}
if err = s.db.breaker.Allow(); err != nil {
stats.Incr("tidb:stmt:exec", "breaker")
_metricReqErr.Inc(s.db.addr, s.db.addr, "stmt:exec", "breaker")
return
}
stmt := s.prepare()
@ -466,7 +466,7 @@ func (s *Stmt) Exec(c context.Context, args ...interface{}) (res sql.Result, err
res, err = stmt.ExecContext(c, args...)
cancel()
s.db.onBreaker(&err)
stats.Timing("tidb:stmt:exec", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), s.db.addr, s.db.addr, "stmt:exec")
if err != nil {
err = errors.Wrapf(err, "addr: %s exec:%s, args:%+v", s.db.addr, s.query, args)
}
@ -488,7 +488,7 @@ func (s *Stmt) Query(c context.Context, args ...interface{}) (rows *Rows, err er
defer t.Finish(&err)
}
if err = s.db.breaker.Allow(); err != nil {
stats.Incr("tidb:stmt:query", "breaker")
_metricReqErr.Inc(s.db.addr, s.db.addr, "stmt:query", "breaker")
return
}
stmt := s.prepare()
@ -499,7 +499,7 @@ func (s *Stmt) Query(c context.Context, args ...interface{}) (rows *Rows, err er
_, c, cancel := s.db.conf.QueryTimeout.Shrink(c)
rs, err := stmt.QueryContext(c, args...)
s.db.onBreaker(&err)
stats.Timing("tidb:stmt:query", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), s.db.addr, s.db.addr, "stmt:query")
if err != nil {
err = errors.Wrapf(err, "addr: %s, query:%s, args:%+v", s.db.addr, s.query, args)
cancel()
@ -528,7 +528,7 @@ func (s *Stmt) QueryRow(c context.Context, args ...interface{}) (row *Row) {
row.t = t
}
if row.err = s.db.breaker.Allow(); row.err != nil {
stats.Incr("tidb:stmt:queryrow", "breaker")
_metricReqErr.Inc(s.db.addr, s.db.addr, "stmt:queryrow", "breaker")
return
}
stmt := s.prepare()
@ -538,7 +538,7 @@ func (s *Stmt) QueryRow(c context.Context, args ...interface{}) (row *Row) {
_, c, cancel := s.db.conf.QueryTimeout.Shrink(c)
row.Row = stmt.QueryRowContext(c, args...)
row.cancel = cancel
stats.Timing("tidb:stmt:queryrow", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), s.db.addr, s.db.addr, "stmt:queryrow")
return
}
@ -626,7 +626,7 @@ func (tx *Tx) Exec(query string, args ...interface{}) (res sql.Result, err error
tx.t.SetTag(trace.String(trace.TagAnnotation, fmt.Sprintf("exec %s", query)))
}
res, err = tx.tx.ExecContext(tx.c, query, args...)
stats.Timing("tidb:tx:exec", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), tx.db.addr, tx.db.addr, "tx:exec")
if err != nil {
err = errors.Wrapf(err, "addr: %s exec:%s, args:%+v", tx.db.addr, query, args)
}
@ -641,7 +641,7 @@ func (tx *Tx) Query(query string, args ...interface{}) (rows *Rows, err error) {
now := time.Now()
defer slowLog(fmt.Sprintf("Query addr: %s query(%s) args(%+v)", tx.db.addr, query, args), now)
defer func() {
stats.Timing("tidb:tx:query", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), tx.db.addr, tx.db.addr, "tx:query")
}()
rs, err := tx.tx.QueryContext(tx.c, query, args...)
if err == nil {
@ -662,7 +662,7 @@ func (tx *Tx) QueryRow(query string, args ...interface{}) *Row {
now := time.Now()
defer slowLog(fmt.Sprintf("QueryRow addr: %s query(%s) args(%+v)", tx.db.addr, query, args), now)
defer func() {
stats.Timing("tidb:tx:queryrow", int64(time.Since(now)/time.Millisecond))
_metricReqDur.Observe(int64(time.Since(now)/time.Millisecond), tx.db.addr, tx.db.addr, "tx:queryrow")
}()
r := tx.tx.QueryRowContext(tx.c, query, args...)
return &Row{Row: r, db: tx.db, query: query, args: args}

@ -3,15 +3,12 @@ package tidb
import (
"github.com/bilibili/kratos/pkg/log"
"github.com/bilibili/kratos/pkg/net/netutil/breaker"
"github.com/bilibili/kratos/pkg/stat"
"github.com/bilibili/kratos/pkg/time"
// database driver
_ "github.com/go-sql-driver/mysql"
)
var stats = stat.DB
// Config mysql config.
type Config struct {
DSN string // dsn

@ -9,7 +9,7 @@ import (
"strconv"
"github.com/bilibili/kratos/pkg/conf/env"
"github.com/bilibili/kratos/pkg/stat/prom"
"github.com/bilibili/kratos/pkg/stat/metric"
)
// Config log config.
@ -44,8 +44,10 @@ type Config struct {
Filter []string
}
// errProm prometheus error counter.
var errProm = prom.BusinessErrCount
// metricErrCount prometheus error counter.
var (
metricErrCount = metric.NewBusinessMetricCount("log_error_total", "source")
)
// Render render log output
type Render interface {
@ -238,6 +240,6 @@ func Close() (err error) {
func errIncr(lv Level, source string) {
if lv == _errorLevel {
errProm.Incr(source)
metricErrCount.Inc(source)
}
}

@ -513,6 +513,7 @@ func (d *Discovery) serverproc() {
case <-d.ctx.Done():
return
case <-ticker.C:
d.switchNode()
default:
}
apps, err := d.polls(ctx)

@ -0,0 +1,324 @@
package etcd
import (
"context"
"encoding/json"
"errors"
"flag"
"fmt"
"os"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/bilibili/kratos/pkg/log"
"github.com/bilibili/kratos/pkg/naming"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/mvcc/mvccpb"
"google.golang.org/grpc"
)
var (
//etcdPrefix is a etcd globe key prefix
endpoints string
etcdPrefix string
//Time units is second
registerTTL = 90
defaultDialTimeout = 30
)
var (
_once sync.Once
_builder naming.Builder
//ErrDuplication is a register duplication err
ErrDuplication = errors.New("etcd: instance duplicate registration")
)
func init() {
addFlag(flag.CommandLine)
}
func addFlag(fs *flag.FlagSet) {
// env
fs.StringVar(&endpoints, "etcd.endpoints", os.Getenv("ETCD_ENDPOINTS"), "etcd.endpoints is etcd endpoints. value: 127.0.0.1:2379,127.0.0.2:2379 etc.")
fs.StringVar(&etcdPrefix, "etcd.prefix", defaultString("ETCD_PREFIX", "kratos_etcd"), "etcd globe key prefix or use ETCD_PREFIX env variable. value etcd_prefix etc.")
}
func defaultString(env, value string) string {
v := os.Getenv(env)
if v == "" {
return value
}
return v
}
// Builder return default etcd resolver builder.
func Builder(c *clientv3.Config) naming.Builder {
_once.Do(func() {
_builder, _ = New(c)
})
return _builder
}
// Build register resolver into default etcd.
func Build(c *clientv3.Config, id string) naming.Resolver {
return Builder(c).Build(id)
}
// EtcdBuilder is a etcd clientv3 EtcdBuilder
type EtcdBuilder struct {
cli *clientv3.Client
ctx context.Context
cancelFunc context.CancelFunc
mutex sync.RWMutex
apps map[string]*appInfo
registry map[string]struct{}
}
type appInfo struct {
resolver map[*Resolve]struct{}
ins atomic.Value
e *EtcdBuilder
once sync.Once
}
// Resolve etch resolver.
type Resolve struct {
id string
event chan struct{}
e *EtcdBuilder
}
// New is new a etcdbuilder
func New(c *clientv3.Config) (e *EtcdBuilder, err error) {
if c == nil {
if endpoints == "" {
panic(fmt.Errorf("invalid etcd config endpoints:%+v", endpoints))
}
c = &clientv3.Config{
Endpoints: strings.Split(endpoints, ","),
DialTimeout: time.Second * time.Duration(defaultDialTimeout),
DialOptions: []grpc.DialOption{grpc.WithBlock()},
}
}
cli, err := clientv3.New(*c)
if err != nil {
return nil, err
}
ctx, cancel := context.WithCancel(context.Background())
e = &EtcdBuilder{
cli: cli,
ctx: ctx,
cancelFunc: cancel,
apps: map[string]*appInfo{},
registry: map[string]struct{}{},
}
return
}
// Build disovery resovler builder.
func (e *EtcdBuilder) Build(appid string) naming.Resolver {
r := &Resolve{
id: appid,
e: e,
event: make(chan struct{}, 1),
}
e.mutex.Lock()
app, ok := e.apps[appid]
if !ok {
app = &appInfo{
resolver: make(map[*Resolve]struct{}),
e: e,
}
e.apps[appid] = app
}
app.resolver[r] = struct{}{}
e.mutex.Unlock()
if ok {
select {
case r.event <- struct{}{}:
default:
}
}
app.once.Do(func() {
go app.watch(appid)
log.Info("etcd: AddWatch(%s) already watch(%v)", appid, ok)
})
return r
}
// Scheme return etcd's scheme
func (e *EtcdBuilder) Scheme() string {
return "etcd"
}
// Register is register instance
func (e *EtcdBuilder) Register(ctx context.Context, ins *naming.Instance) (cancelFunc context.CancelFunc, err error) {
e.mutex.Lock()
if _, ok := e.registry[ins.AppID]; ok {
err = ErrDuplication
} else {
e.registry[ins.AppID] = struct{}{}
}
e.mutex.Unlock()
if err != nil {
return
}
ctx, cancel := context.WithCancel(e.ctx)
if err = e.register(ctx, ins); err != nil {
e.mutex.Lock()
delete(e.registry, ins.AppID)
e.mutex.Unlock()
cancel()
return
}
ch := make(chan struct{}, 1)
cancelFunc = context.CancelFunc(func() {
cancel()
<-ch
})
go func() {
ticker := time.NewTicker(time.Duration(registerTTL/3) * time.Second)
defer ticker.Stop()
for {
select {
case <-ticker.C:
_ = e.register(ctx, ins)
case <-ctx.Done():
_ = e.unregister(ins)
ch <- struct{}{}
return
}
}
}()
return
}
//注册和续约公用一个操作
func (e *EtcdBuilder) register(ctx context.Context, ins *naming.Instance) (err error) {
prefix := e.keyPrefix(ins)
val, _ := json.Marshal(ins)
ttlResp, err := e.cli.Grant(context.TODO(), int64(registerTTL))
if err != nil {
log.Error("etcd: register client.Grant(%v) error(%v)", registerTTL, err)
return err
}
_, err = e.cli.Put(ctx, prefix, string(val), clientv3.WithLease(ttlResp.ID))
if err != nil {
log.Error("etcd: register client.Put(%v) appid(%s) hostname(%s) error(%v)",
prefix, ins.AppID, ins.Hostname, err)
return err
}
return nil
}
func (e *EtcdBuilder) unregister(ins *naming.Instance) (err error) {
prefix := e.keyPrefix(ins)
if _, err = e.cli.Delete(context.TODO(), prefix); err != nil {
log.Error("etcd: unregister client.Delete(%v) appid(%s) hostname(%s) error(%v)",
prefix, ins.AppID, ins.Hostname, err)
}
log.Info("etcd: unregister client.Delete(%v) appid(%s) hostname(%s) success",
prefix, ins.AppID, ins.Hostname)
return
}
func (e *EtcdBuilder) keyPrefix(ins *naming.Instance) string {
return fmt.Sprintf("/%s/%s/%s", etcdPrefix, ins.AppID, ins.Hostname)
}
// Close stop all running process including etcdfetch and register
func (e *EtcdBuilder) Close() error {
e.cancelFunc()
return nil
}
func (a *appInfo) watch(appID string) {
_ = a.fetchstore(appID)
prefix := fmt.Sprintf("/%s/%s/", etcdPrefix, appID)
rch := a.e.cli.Watch(a.e.ctx, prefix, clientv3.WithPrefix())
for wresp := range rch {
for _, ev := range wresp.Events {
if ev.Type == mvccpb.PUT || ev.Type == mvccpb.DELETE {
_ = a.fetchstore(appID)
}
}
}
}
func (a *appInfo) fetchstore(appID string) (err error) {
prefix := fmt.Sprintf("/%s/%s/", etcdPrefix, appID)
resp, err := a.e.cli.Get(a.e.ctx, prefix, clientv3.WithPrefix())
if err != nil {
log.Error("etcd: fetch client.Get(%s) error(%+v)", prefix, err)
return err
}
ins, err := a.paserIns(resp)
if err != nil {
return err
}
a.store(ins)
return nil
}
func (a *appInfo) store(ins *naming.InstancesInfo) {
a.ins.Store(ins)
a.e.mutex.RLock()
for rs := range a.resolver {
select {
case rs.event <- struct{}{}:
default:
}
}
a.e.mutex.RUnlock()
}
func (a *appInfo) paserIns(resp *clientv3.GetResponse) (ins *naming.InstancesInfo, err error) {
ins = &naming.InstancesInfo{
Instances: make(map[string][]*naming.Instance, 0),
}
for _, ev := range resp.Kvs {
in := new(naming.Instance)
err := json.Unmarshal(ev.Value, in)
if err != nil {
return nil, err
}
ins.Instances[in.Zone] = append(ins.Instances[in.Zone], in)
}
return ins, nil
}
// Watch watch instance.
func (r *Resolve) Watch() <-chan struct{} {
return r.event
}
// Fetch fetch resolver instance.
func (r *Resolve) Fetch(ctx context.Context) (ins *naming.InstancesInfo, ok bool) {
r.e.mutex.RLock()
app, ok := r.e.apps[r.id]
r.e.mutex.RUnlock()
if ok {
ins, ok = app.ins.Load().(*naming.InstancesInfo)
return
}
return
}
// Close close resolver.
func (r *Resolve) Close() error {
r.e.mutex.Lock()
if app, ok := r.e.apps[r.id]; ok && len(app.resolver) != 0 {
delete(app.resolver, r)
}
r.e.mutex.Unlock()
return nil
}

@ -0,0 +1,99 @@
package etcd
import (
"context"
"fmt"
"testing"
"time"
"github.com/bilibili/kratos/pkg/naming"
"go.etcd.io/etcd/clientv3"
"google.golang.org/grpc"
)
func TestNew(t *testing.T) {
config := &clientv3.Config{
Endpoints: []string{"127.0.0.1:2379"},
DialTimeout: time.Second * 3,
DialOptions: []grpc.DialOption{grpc.WithBlock()},
}
builder, err := New(config)
if err != nil {
fmt.Println("etcd 连接失败")
return
}
app1 := builder.Build("app1")
go func() {
fmt.Printf("Watch \n")
for {
select {
case <-app1.Watch():
fmt.Printf("app1 节点发生变化 \n")
}
}
}()
time.Sleep(time.Second)
app1Cancel, err := builder.Register(context.Background(), &naming.Instance{
AppID: "app1",
Hostname: "h1",
Zone: "z1",
})
app2Cancel, err := builder.Register(context.Background(), &naming.Instance{
AppID: "app2",
Hostname: "h5",
Zone: "z3",
})
if err != nil {
fmt.Println(err)
}
app2 := builder.Build("app2")
go func() {
fmt.Println("节点列表")
for {
fmt.Printf("app1: ")
r1, _ := app1.Fetch(context.Background())
if r1 != nil {
for z, ins := range r1.Instances {
fmt.Printf("zone: %s :", z)
for _, in := range ins {
fmt.Printf("app: %s host %s \n", in.AppID, in.Hostname)
}
}
} else {
fmt.Printf("\n")
}
fmt.Printf("app2: ")
r2, _ := app2.Fetch(context.Background())
if r2 != nil {
for z, ins := range r2.Instances {
fmt.Printf("zone: %s :", z)
for _, in := range ins {
fmt.Printf("app: %s host %s \n", in.AppID, in.Hostname)
}
}
} else {
fmt.Printf("\n")
}
time.Sleep(time.Second)
}
}()
time.Sleep(time.Second * 5)
fmt.Println("取消app1")
app1Cancel()
time.Sleep(time.Second * 10)
fmt.Println("取消app2")
app2Cancel()
time.Sleep(30 * time.Second)
}

@ -20,7 +20,6 @@ import (
"github.com/bilibili/kratos/pkg/conf/env"
"github.com/bilibili/kratos/pkg/net/metadata"
"github.com/bilibili/kratos/pkg/net/netutil/breaker"
"github.com/bilibili/kratos/pkg/stat"
xtime "github.com/bilibili/kratos/pkg/time"
"github.com/gogo/protobuf/proto"
@ -33,7 +32,6 @@ const (
var (
_noKickUserAgent = "blademaster"
clientStats = stat.HTTPClient
)
func init() {
@ -215,16 +213,16 @@ func (client *Client) Raw(c context.Context, req *xhttp.Request, v ...string) (b
brk := client.breaker.Get(uri)
if err = brk.Allow(); err != nil {
code = "breaker"
clientStats.Incr(uri, code)
_metricClientReqCodeTotal.Inc(uri, code)
return
}
defer client.onBreaker(brk, &err)
// stat
now := time.Now()
defer func() {
clientStats.Timing(uri, int64(time.Since(now)/time.Millisecond))
_metricClientReqDur.Observe(int64(time.Since(now)/time.Millisecond), uri)
if code != "" {
clientStats.Incr(uri, code)
_metricClientReqCodeTotal.Inc(uri, code)
}
}()
// get config

@ -34,8 +34,8 @@ func Logger() HandlerFunc {
caller = noUser
}
stats.Incr(caller, path[1:], strconv.FormatInt(int64(cerr.Code()), 10))
stats.Timing(caller, int64(dt/time.Millisecond), path[1:])
_metricServerReqCodeTotal.Inc(c.RoutePath[1:], caller, strconv.FormatInt(int64(cerr.Code()), 10))
_metricServerReqDur.Observe(int64(dt/time.Millisecond), c.RoutePath[1:], caller)
lf := log.Infov
errmsg := ""

@ -52,7 +52,7 @@ var _parser = map[string]func(string) interface{}{
func parseMetadataTo(req *http.Request, to metadata.MD) {
for rawKey := range req.Header {
key := strings.ReplaceAll(strings.TrimLeft(strings.ToLower(rawKey), _httpHeaderMetadata), "-", "_")
key := strings.ReplaceAll(strings.TrimPrefix(strings.ToLower(rawKey), _httpHeaderMetadata), "-", "_")
rawValue := req.Header.Get(rawKey)
var value interface{} = rawValue
parser, ok := _parser[key]

@ -0,0 +1,48 @@
package blademaster
import "github.com/bilibili/kratos/pkg/stat/metric"
const (
clientNamespace = "http_client"
serverNamespace = "http_server"
)
var (
_metricServerReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: serverNamespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "http server requests duration(ms).",
Labels: []string{"path", "caller"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000},
})
_metricServerReqCodeTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: serverNamespace,
Subsystem: "requests",
Name: "code_total",
Help: "http server requests error count.",
Labels: []string{"path", "caller", "code"},
})
_metricServerBBR = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: serverNamespace,
Subsystem: "",
Name: "bbr_total",
Help: "http server bbr total.",
Labels: []string{"url"},
})
_metricClientReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: clientNamespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "http client requests duration(ms).",
Labels: []string{"path"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000},
})
_metricClientReqCodeTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: clientNamespace,
Subsystem: "requests",
Name: "code_total",
Help: "http client requests code count.",
Labels: []string{"path", "code"},
})
)

@ -8,15 +8,6 @@ import (
"github.com/bilibili/kratos/pkg/log"
limit "github.com/bilibili/kratos/pkg/ratelimit"
"github.com/bilibili/kratos/pkg/ratelimit/bbr"
"github.com/bilibili/kratos/pkg/stat/prom"
)
const (
_statName = "go_http_bbr"
)
var (
bbrStats = prom.New().WithState("go_http_bbr", []string{"url"})
)
// RateLimiter bbr middleware.
@ -48,7 +39,7 @@ func (b *RateLimiter) Limit() HandlerFunc {
limiter := b.group.Get(uri)
done, err := limiter.Allow(c)
if err != nil {
bbrStats.Incr(_statName, uri)
_metricServerBBR.Inc(uri)
c.JSON(nil, err)
c.Abort()
return

@ -18,7 +18,6 @@ import (
"github.com/bilibili/kratos/pkg/net/criticality"
"github.com/bilibili/kratos/pkg/net/ip"
"github.com/bilibili/kratos/pkg/net/metadata"
"github.com/bilibili/kratos/pkg/stat"
xtime "github.com/bilibili/kratos/pkg/time"
"github.com/pkg/errors"
@ -30,12 +29,10 @@ const (
var (
_ IRouter = &Engine{}
stats = stat.HTTPServer
_httpDSN string
default405Body = []byte("405 method not allowed")
default404Body = []byte("404 page not found")
)
func init() {
@ -155,7 +152,6 @@ type Engine struct {
allNoMethod []HandlerFunc
noRoute []HandlerFunc
noMethod []HandlerFunc
}
type injection struct {
@ -177,9 +173,6 @@ func NewServer(conf *ServerConfig) *Engine {
basePath: "/",
root: true,
},
conf: &ServerConfig{
Timeout: xtime.Duration(time.Second),
},
address: ip.InternalIP(),
trees: make(methodTrees, 0, 9),
metastore: make(map[string]map[string]interface{}),
@ -187,6 +180,9 @@ func NewServer(conf *ServerConfig) *Engine {
HandleMethodNotAllowed: true,
injections: make([]injection, 0),
}
if err := engine.SetConfig(conf); err != nil {
panic(err)
}
engine.RouterGroup.engine = engine
// NOTE add prometheus monitor location
engine.addRoute("GET", "/metrics", monitor())

@ -31,9 +31,6 @@ const (
// Mid 外网账户用户id
Mid = "mid" // NOTE: !!!业务可重新修改key名!!!
// Username LDAP平台的username
Username = "username"
// Device 客户端信息
Device = "device"

@ -3,6 +3,7 @@ package breaker
import (
"math"
"math/rand"
"sync"
"sync/atomic"
"time"
@ -14,12 +15,14 @@ import (
// sreBreaker is a sre CircuitBreaker pattern.
type sreBreaker struct {
stat metric.RollingCounter
r *rand.Rand
// rand.New(...) returns a non thread safe object
randLock sync.Mutex
k float64
request int64
state int32
r *rand.Rand
}
func newSRE(c *Config) Breaker {
@ -69,15 +72,15 @@ func (b *sreBreaker) Allow() error {
atomic.CompareAndSwapInt32(&b.state, StateClosed, StateOpen)
}
dr := math.Max(0, (float64(total)-k)/float64(total+1))
rr := b.r.Float64()
drop := b.trueOnProba(dr)
if log.V(5) {
log.Info("breaker: drop ratio: %f, real rand: %f, drop: %v", dr, rr, dr > rr)
}
if dr <= rr {
return nil
log.Info("breaker: drop ratio: %f, drop: %t", dr, drop)
}
if drop {
return ecode.ServiceUnavailable
}
return nil
}
func (b *sreBreaker) MarkSuccess() {
b.stat.Add(1)
@ -88,3 +91,10 @@ func (b *sreBreaker) MarkFailed() {
// drop ratio higher.
b.stat.Add(0)
}
func (b *sreBreaker) trueOnProba(proba float64) (truth bool) {
b.randLock.Lock()
truth = b.r.Float64() < proba
b.randLock.Unlock()
return
}

@ -147,6 +147,22 @@ func TestSRESummary(t *testing.T) {
})
}
func TestTrueOnProba(t *testing.T) {
const proba = math.Pi / 10
const total = 100000
const epsilon = 0.05
var count int
b := getSREBreaker()
for i := 0; i < total; i++ {
if b.trueOnProba(proba) {
count++
}
}
ratio := float64(count) / float64(total)
assert.InEpsilon(t, proba, ratio, epsilon)
}
func BenchmarkSreBreakerAllow(b *testing.B) {
breaker := getSRE()
b.ResetTimer()

@ -3,6 +3,8 @@ package warden
import (
"context"
"fmt"
"github.com/bilibili/kratos/pkg/net/rpc/warden/resolver"
"github.com/bilibili/kratos/pkg/net/rpc/warden/resolver/direct"
"net/url"
"os"
"strconv"
@ -51,6 +53,11 @@ func baseMetadata() metadata.MD {
return gmd
}
// Register direct resolver by default to handle direct:// scheme.
func init() {
resolver.Register(direct.New())
}
// ClientConfig is rpc client conf.
type ClientConfig struct {
Dial xtime.Duration
@ -116,7 +123,7 @@ func (c *Client) handle() grpc.UnaryClientInterceptor {
c.mutex.RUnlock()
brk := c.breaker.Get(method)
if err = brk.Allow(); err != nil {
statsClient.Incr(method, "breaker")
_metricClientReqCodeTotal.Inc(method, "breaker")
return
}
defer onBreaker(brk, &err)

@ -12,12 +12,6 @@ import (
"github.com/bilibili/kratos/pkg/ecode"
"github.com/bilibili/kratos/pkg/log"
"github.com/bilibili/kratos/pkg/net/metadata"
"github.com/bilibili/kratos/pkg/stat"
)
var (
statsClient = stat.RPCClient
statsServer = stat.RPCServer
)
// Warden Log Flag
@ -94,8 +88,8 @@ func clientLogging(dialOptions ...grpc.DialOption) grpc.UnaryClientInterceptor {
code := ecode.Cause(err).Code()
duration := time.Since(startTime)
// monitor
statsClient.Timing(method, int64(duration/time.Millisecond))
statsClient.Incr(method, strconv.Itoa(code))
_metricClientReqDur.Observe(int64(duration/time.Millisecond), method)
_metricClientReqCodeTotal.Inc(method, strconv.Itoa(code))
if logFlag&LogFlagDisable != 0 {
return err
@ -148,8 +142,8 @@ func serverLogging(logFlag int8) grpc.UnaryServerInterceptor {
code := ecode.Cause(err).Code()
duration := time.Since(startTime)
// monitor
statsServer.Timing(caller, int64(duration/time.Millisecond), info.FullMethod)
statsServer.Incr(caller, info.FullMethod, strconv.Itoa(code))
_metricServerReqDur.Observe(int64(duration/time.Millisecond), info.FullMethod, caller)
_metricServerReqCodeTotal.Inc(info.FullMethod, caller, strconv.Itoa(code))
if logFlag&LogFlagDisable != 0 {
return resp, err

@ -0,0 +1,41 @@
package warden
import "github.com/bilibili/kratos/pkg/stat/metric"
const (
clientNamespace = "grpc_client"
serverNamespace = "grpc_server"
)
var (
_metricServerReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: serverNamespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "grpc server requests duration(ms).",
Labels: []string{"method", "caller"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000},
})
_metricServerReqCodeTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: serverNamespace,
Subsystem: "requests",
Name: "code_total",
Help: "grpc server requests code count.",
Labels: []string{"method", "caller", "code"},
})
_metricClientReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
Namespace: clientNamespace,
Subsystem: "requests",
Name: "duration_ms",
Help: "grpc client requests duration(ms).",
Labels: []string{"method"},
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000},
})
_metricClientReqCodeTotal = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: clientNamespace,
Subsystem: "requests",
Name: "code_total",
Help: "grpc client requests code count.",
Labels: []string{"method", "code"},
})
)

@ -8,17 +8,18 @@ import (
"github.com/bilibili/kratos/pkg/log"
limit "github.com/bilibili/kratos/pkg/ratelimit"
"github.com/bilibili/kratos/pkg/ratelimit/bbr"
"github.com/bilibili/kratos/pkg/stat/prom"
"github.com/bilibili/kratos/pkg/stat/metric"
"google.golang.org/grpc"
)
const (
_statName = "go_grpc_bbr"
)
var (
stats = prom.New().WithState("go_grpc_bbr", []string{"url"})
_metricServerBBR = metric.NewCounterVec(&metric.CounterVecOpts{
Namespace: "grpc_server",
Subsystem: "",
Name: "bbr_total",
Help: "grpc server bbr total.",
Labels: []string{"url"},
})
)
// RateLimiter bbr middleware.
@ -50,7 +51,7 @@ func (b *RateLimiter) Limit() grpc.UnaryServerInterceptor {
limiter := b.group.Get(uri)
done, err := limiter.Allow(ctx)
if err != nil {
stats.Incr(_statName, uri)
_metricServerBBR.Inc(uri)
return
}
defer func() {

@ -304,6 +304,7 @@ func (s *Server) Start() (*Server, error) {
if err != nil {
return nil, err
}
log.Info("warden: start grpc listen addr: %v", lis.Addr())
reflection.Register(s.server)
go func() {
if err := s.Serve(lis); err != nil {

@ -27,7 +27,11 @@ type Span struct {
childs int
}
func (s *Span) Name() string {
func (s *Span) ServiceName() string {
return s.dapper.serviceName
}
func (s *Span) OperationName() string {
return s.operationName
}

@ -37,11 +37,12 @@ func (r *report) WriteSpan(raw *trace.Span) (err error) {
ID: spanID,
ParentID: &parentID,
},
Name: raw.Name(),
Name: raw.OperationName(),
Timestamp: raw.StartTime(),
Duration: raw.Duration(),
Tags: make(map[string]string, len(tags)+len(logs)),
}
span.LocalEndpoint = &model.Endpoint{ServiceName: raw.ServiceName()}
for _, tag := range tags {
switch tag.Key {
case trace.TagSpanKind:
@ -55,8 +56,6 @@ func (r *report) WriteSpan(raw *trace.Span) (err error) {
case "consumer":
span.Kind = model.Consumer
}
case trace.TagPeerService:
span.LocalEndpoint = &model.Endpoint{ServiceName: tag.Value.(string)}
default:
v, ok := tag.Value.(string)
if ok {

@ -3,6 +3,8 @@ package metric
import (
"fmt"
"sync/atomic"
"github.com/prometheus/client_golang/prometheus"
)
var _ Metric = &counter{}
@ -34,3 +36,49 @@ func (c *counter) Add(val int64) {
func (c *counter) Value() int64 {
return atomic.LoadInt64(&c.val)
}
// CounterVecOpts is an alias of VectorOpts.
type CounterVecOpts VectorOpts
// CounterVec counter vec.
type CounterVec interface {
// Inc increments the counter by 1. Use Add to increment it by arbitrary
// non-negative values.
Inc(labels ...string)
// Add adds the given value to the counter. It panics if the value is <
// 0.
Add(v float64, labels ...string)
}
// counterVec counter vec.
type promCounterVec struct {
counter *prometheus.CounterVec
}
// NewCounterVec .
func NewCounterVec(cfg *CounterVecOpts) CounterVec {
if cfg == nil {
return nil
}
vec := prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: cfg.Namespace,
Subsystem: cfg.Subsystem,
Name: cfg.Name,
Help: cfg.Help,
}, cfg.Labels)
prometheus.MustRegister(vec)
return &promCounterVec{
counter: vec,
}
}
// Inc Inc increments the counter by 1. Use Add to increment it by arbitrary.
func (counter *promCounterVec) Inc(labels ...string) {
counter.counter.WithLabelValues(labels...).Inc()
}
// Add Inc increments the counter by 1. Use Add to increment it by arbitrary.
func (counter *promCounterVec) Add(v float64, labels ...string) {
counter.counter.WithLabelValues(labels...).Add(v)
}

@ -16,3 +16,32 @@ func TestCounter(t *testing.T) {
val := counter.Value()
assert.Equal(t, val, int64(count))
}
func TestCounterVec(t *testing.T) {
counterVec := NewCounterVec(&CounterVecOpts{
Namespace: "test",
Subsystem: "test",
Name: "test",
Help: "this is test metrics.",
Labels: []string{"name", "addr"},
})
counterVec.Inc("name1", "127.0.0.1")
assert.Panics(t, func() {
NewCounterVec(&CounterVecOpts{
Namespace: "test",
Subsystem: "test",
Name: "test",
Help: "this is test metrics.",
Labels: []string{"name", "addr"},
})
}, "Expected to panic.")
assert.NotPanics(t, func() {
NewCounterVec(&CounterVecOpts{
Namespace: "test",
Subsystem: "test",
Name: "test2",
Help: "this is test metrics.",
Labels: []string{"name", "addr"},
})
}, "Expected normal. no panic.")
}

@ -1,6 +1,10 @@
package metric
import "sync/atomic"
import (
"sync/atomic"
"github.com/prometheus/client_golang/prometheus"
)
var _ Metric = &gauge{}
@ -35,3 +39,56 @@ func (g *gauge) Set(val int64) {
func (g *gauge) Value() int64 {
return atomic.LoadInt64(&g.val)
}
// GaugeVecOpts is an alias of VectorOpts.
type GaugeVecOpts VectorOpts
// GaugeVec gauge vec.
type GaugeVec interface {
// Set sets the Gauge to an arbitrary value.
Set(v float64, labels ...string)
// Inc increments the Gauge by 1. Use Add to increment it by arbitrary
// values.
Inc(labels ...string)
// Add adds the given value to the Gauge. (The value can be negative,
// resulting in a decrease of the Gauge.)
Add(v float64, labels ...string)
}
// gaugeVec gauge vec.
type promGaugeVec struct {
gauge *prometheus.GaugeVec
}
// NewGaugeVec .
func NewGaugeVec(cfg *GaugeVecOpts) GaugeVec {
if cfg == nil {
return nil
}
vec := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: cfg.Namespace,
Subsystem: cfg.Subsystem,
Name: cfg.Name,
Help: cfg.Help,
}, cfg.Labels)
prometheus.MustRegister(vec)
return &promGaugeVec{
gauge: vec,
}
}
// Inc Inc increments the counter by 1. Use Add to increment it by arbitrary.
func (gauge *promGaugeVec) Inc(labels ...string) {
gauge.gauge.WithLabelValues(labels...).Inc()
}
// Add Inc increments the counter by 1. Use Add to increment it by arbitrary.
func (gauge *promGaugeVec) Add(v float64, labels ...string) {
gauge.gauge.WithLabelValues(labels...).Add(v)
}
// Set set the given value to the collection.
func (gauge *promGaugeVec) Set(v float64, labels ...string) {
gauge.gauge.WithLabelValues(labels...).Set(v)
}

@ -0,0 +1,50 @@
package metric
import (
"github.com/prometheus/client_golang/prometheus"
)
// HistogramVecOpts is histogram vector opts.
type HistogramVecOpts struct {
Namespace string
Subsystem string
Name string
Help string
Labels []string
Buckets []float64
}
// HistogramVec gauge vec.
type HistogramVec interface {
// Observe adds a single observation to the histogram.
Observe(v int64, labels ...string)
}
// Histogram prom histogram collection.
type promHistogramVec struct {
histogram *prometheus.HistogramVec
}
// NewHistogramVec new a histogram vec.
func NewHistogramVec(cfg *HistogramVecOpts) HistogramVec {
if cfg == nil {
return nil
}
vec := prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: cfg.Namespace,
Subsystem: cfg.Subsystem,
Name: cfg.Name,
Help: cfg.Help,
Buckets: cfg.Buckets,
}, cfg.Labels)
prometheus.MustRegister(vec)
return &promHistogramVec{
histogram: vec,
}
}
// Timing adds a single observation to the histogram.
func (histogram *promHistogramVec) Observe(v int64, labels ...string) {
histogram.histogram.WithLabelValues(labels...).Observe(float64(v))
}

@ -1,5 +1,7 @@
package metric
import "errors"
// Opts contains the common arguments for creating Metric.
type Opts struct {
}
@ -28,3 +30,69 @@ type Aggregation interface {
// Sum computes sum value within the window.
Sum() float64
}
// VectorOpts contains the common arguments for creating vec Metric..
type VectorOpts struct {
Namespace string
Subsystem string
Name string
Help string
Labels []string
}
const (
_businessNamespace = "business"
_businessSubsystemCount = "count"
_businessSubSystemGauge = "gauge"
_businessSubSystemHistogram = "histogram"
)
var (
_defaultBuckets = []float64{5, 10, 25, 50, 100, 250, 500}
)
// NewBusinessMetricCount business Metric count vec.
// name or labels should not be empty.
func NewBusinessMetricCount(name string, labels ...string) CounterVec {
if name == "" || len(labels) == 0 {
panic(errors.New("stat:metric business count metric name should not be empty or labels length should be greater than zero"))
}
return NewCounterVec(&CounterVecOpts{
Namespace: _businessNamespace,
Subsystem: _businessSubsystemCount,
Name: name,
Labels: labels,
})
}
// NewBusinessMetricGauge business Metric gauge vec.
// name or labels should not be empty.
func NewBusinessMetricGauge(name string, labels ...string) GaugeVec {
if name == "" || len(labels) == 0 {
panic(errors.New("stat:metric business gauge metric name should not be empty or labels length should be greater than zero"))
}
return NewGaugeVec(&GaugeVecOpts{
Namespace: _businessNamespace,
Subsystem: _businessSubSystemGauge,
Name: name,
Labels: labels,
})
}
// NewBusinessMetricHistogram business Metric histogram vec.
// name or labels should not be empty.
func NewBusinessMetricHistogram(name string, buckets []float64, labels ...string) HistogramVec {
if name == "" || len(labels) == 0 {
panic(errors.New("stat:metric business histogram metric name should not be empty or labels length should be greater than zero"))
}
if len(buckets) == 0 {
buckets = _defaultBuckets
}
return NewHistogramVec(&HistogramVecOpts{
Namespace: _businessNamespace,
Subsystem: _businessSubSystemHistogram,
Name: name,
Labels: labels,
Buckets: buckets,
})
}

@ -1,5 +0,0 @@
# prom
## 项目简介
封装prometheus类。TODO:补充grafana通用面板json文件!!!

@ -1,163 +0,0 @@
package prom
import (
"flag"
"os"
"sync"
"github.com/prometheus/client_golang/prometheus"
)
var (
// LibClient for mc redis and db client.
LibClient = New().WithTimer("go_lib_client", []string{"method"}).WithCounter("go_lib_client_code", []string{"method", "code"})
// RPCClient rpc client
RPCClient = New().WithTimer("go_rpc_client", []string{"method"}).WithCounter("go_rpc_client_code", []string{"method", "code"})
// HTTPClient http client
HTTPClient = New().WithTimer("go_http_client", []string{"method"}).WithCounter("go_http_client_code", []string{"method", "code"})
// HTTPServer for http server
HTTPServer = New().WithTimer("go_http_server", []string{"user", "method"}).WithCounter("go_http_server_code", []string{"user", "method", "code"})
// RPCServer for rpc server
RPCServer = New().WithTimer("go_rpc_server", []string{"user", "method"}).WithCounter("go_rpc_server_code", []string{"user", "method", "code"})
// BusinessErrCount for business err count
BusinessErrCount = New().WithCounter("go_business_err_count", []string{"name"}).WithState("go_business_err_state", []string{"name"})
// BusinessInfoCount for business info count
BusinessInfoCount = New().WithCounter("go_business_info_count", []string{"name"}).WithState("go_business_info_state", []string{"name"})
// CacheHit for cache hit
CacheHit = New().WithCounter("go_cache_hit", []string{"name"})
// CacheMiss for cache miss
CacheMiss = New().WithCounter("go_cache_miss", []string{"name"})
// UseSummary use summary for Objectives that defines the quantile rank estimates.
_useSummary bool
)
// Prom struct info
type Prom struct {
histogram *prometheus.HistogramVec
summary *prometheus.SummaryVec
counter *prometheus.GaugeVec
state *prometheus.GaugeVec
once sync.Once
}
// New creates a Prom instance.
func New() *Prom {
return &Prom{}
}
func init() {
addFlag(flag.CommandLine)
}
func addFlag(fs *flag.FlagSet) {
v := os.Getenv("PROM_SUMMARY")
if v == "true" {
_useSummary = true
}
fs.BoolVar(&_useSummary, "prom_summary", _useSummary, "use summary in prometheus")
}
// WithTimer with summary timer
func (p *Prom) WithTimer(name string, labels []string) *Prom {
if p == nil {
return p
}
if p.histogram == nil {
p.histogram = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: name,
Help: name,
}, labels)
}
if p.summary == nil {
p.summary = prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Name: name,
Help: name,
Objectives: map[float64]float64{0.99: 0.001, 0.9: 0.01},
}, labels)
}
return p
}
// WithCounter sets counter.
func (p *Prom) WithCounter(name string, labels []string) *Prom {
if p == nil || p.counter != nil {
return p
}
p.counter = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: name,
Help: name,
}, labels)
prometheus.MustRegister(p.counter)
return p
}
// WithState sets state.
func (p *Prom) WithState(name string, labels []string) *Prom {
if p == nil || p.state != nil {
return p
}
p.state = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: name,
Help: name,
}, labels)
prometheus.MustRegister(p.state)
return p
}
// Timing log timing information (in milliseconds) without sampling
func (p *Prom) Timing(name string, time int64, extra ...string) {
p.once.Do(func() {
if _useSummary && p.summary != nil {
prometheus.MustRegister(p.summary)
return
}
if !_useSummary && p.histogram != nil {
prometheus.MustRegister(p.histogram)
}
})
label := append([]string{name}, extra...)
if _useSummary && p.summary != nil {
p.summary.WithLabelValues(label...).Observe(float64(time))
return
}
if !_useSummary && p.histogram != nil {
p.histogram.WithLabelValues(label...).Observe(float64(time))
}
}
// Incr increments one stat counter without sampling
func (p *Prom) Incr(name string, extra ...string) {
label := append([]string{name}, extra...)
if p.counter != nil {
p.counter.WithLabelValues(label...).Inc()
}
}
// Decr decrements one stat counter without sampling
func (p *Prom) Decr(name string, extra ...string) {
if p.counter != nil {
label := append([]string{name}, extra...)
p.counter.WithLabelValues(label...).Dec()
}
}
// State set state
func (p *Prom) State(name string, v int64, extra ...string) {
if p.state != nil {
label := append([]string{name}, extra...)
p.state.WithLabelValues(label...).Set(float64(v))
}
}
// Add add count v must > 0
func (p *Prom) Add(name string, v int64, extra ...string) {
label := append([]string{name}, extra...)
if p.counter != nil {
p.counter.WithLabelValues(label...).Add(float64(v))
}
}

@ -1,25 +0,0 @@
package stat
import (
"github.com/bilibili/kratos/pkg/stat/prom"
)
// Stat interface.
type Stat interface {
Timing(name string, time int64, extra ...string)
Incr(name string, extra ...string) // name,ext...,code
State(name string, val int64, extra ...string)
}
// default stat struct.
var (
// http
HTTPClient Stat = prom.HTTPClient
HTTPServer Stat = prom.HTTPServer
// storage
Cache Stat = prom.LibClient
DB Stat = prom.LibClient
// rpc
RPCClient Stat = prom.RPCClient
RPCServer Stat = prom.RPCServer
)

@ -9,13 +9,11 @@ import (
"github.com/bilibili/kratos/pkg/log"
"github.com/bilibili/kratos/pkg/net/metadata"
"github.com/bilibili/kratos/pkg/net/trace"
"github.com/bilibili/kratos/pkg/stat/prom"
)
var (
// ErrFull chan full.
ErrFull = errors.New("fanout: chan full")
stats = prom.BusinessInfoCount
traceTags = []trace.Tag{
trace.Tag{Key: trace.TagSpanKind, Value: "background"},
trace.Tag{Key: trace.TagComponent, Value: "sync/pipeline/fanout"},
@ -97,7 +95,7 @@ func (c *Fanout) proc() {
select {
case t := <-c.ch:
wrapFunc(t.f)(t.ctx)
stats.State(c.name+"_channel", int64(len(c.ch)))
_metricChanSize.Set(float64(len(c.ch)), c.name)
case <-c.ctx.Done():
return
}
@ -136,7 +134,7 @@ func (c *Fanout) Do(ctx context.Context, f func(ctx context.Context)) (err error
default:
err = ErrFull
}
stats.State(c.name+"_channel", int64(len(c.ch)))
_metricChanSize.Set(float64(len(c.ch)), c.name)
return
}

@ -0,0 +1,15 @@
package fanout
import "github.com/bilibili/kratos/pkg/stat/metric"
const namespace = "sync"
var (
_metricChanSize = metric.NewGaugeVec(&metric.GaugeVecOpts{
Namespace: namespace,
Subsystem: "pipeline_fanout",
Name: "current",
Help: "sync pipeline fanout current channel size.",
Labels: []string{"name"},
})
)

@ -1,21 +0,0 @@
# Google Ads API - proto definitions
This folder contains the [protocol
buffer](https://developers.google.com/protocol-buffers/) definitions for the
[Google Ads API](https://developers.google.com/google-ads/api/). To use this
API, we encourage you to take a look at our [official client
libraries](https://developers.google.com/google-ads/api/docs/client-libs) for
Java, Ruby, PHP, Python or .NET. Refer to the
[Quickstart](https://developers.google.com/google-ads/api/docs/first-call/overview)
to learn how to make your first API call.
To develop in a programming language without an official client library, refer
to the [API Concepts
Guide](https://developers.google.com/google-ads/api/docs/concepts/overview) and
consult these protocol buffer definitions as a reference when constructing API
requests.
Use [the official Google Ads API
forum](https://groups.google.com/d/forum/adwords-api) to request an official
client library in another programming language, report bugs, request new
features in the Google Ads API, or provide feedback.

@ -1,276 +0,0 @@
type: google.api.Service
config_version: 3
name: googleads.googleapis.com
title: Google Ads API
apis:
- name: google.ads.googleads.v0.services.AccountBudgetProposalService
- name: google.ads.googleads.v0.services.AccountBudgetService
- name: google.ads.googleads.v0.services.AdGroupAdService
- name: google.ads.googleads.v0.services.AdGroupAudienceViewService
- name: google.ads.googleads.v0.services.AdGroupBidModifierService
- name: google.ads.googleads.v0.services.AdGroupCriterionService
- name: google.ads.googleads.v0.services.AdGroupFeedService
- name: google.ads.googleads.v0.services.AdGroupService
- name: google.ads.googleads.v0.services.AgeRangeViewService
- name: google.ads.googleads.v0.services.BiddingStrategyService
- name: google.ads.googleads.v0.services.BillingSetupService
- name: google.ads.googleads.v0.services.CampaignAudienceViewService
- name: google.ads.googleads.v0.services.CampaignBidModifierService
- name: google.ads.googleads.v0.services.CampaignBudgetService
- name: google.ads.googleads.v0.services.CampaignCriterionService
- name: google.ads.googleads.v0.services.CampaignFeedService
- name: google.ads.googleads.v0.services.CampaignGroupService
- name: google.ads.googleads.v0.services.CampaignService
- name: google.ads.googleads.v0.services.CampaignSharedSetService
- name: google.ads.googleads.v0.services.CarrierConstantService
- name: google.ads.googleads.v0.services.ChangeStatusService
- name: google.ads.googleads.v0.services.ConversionActionService
- name: google.ads.googleads.v0.services.CustomerClientLinkService
- name: google.ads.googleads.v0.services.CustomerClientService
- name: google.ads.googleads.v0.services.CustomerFeedService
- name: google.ads.googleads.v0.services.CustomerManagerLinkService
- name: google.ads.googleads.v0.services.CustomerService
- name: google.ads.googleads.v0.services.DisplayKeywordViewService
- name: google.ads.googleads.v0.services.FeedItemService
- name: google.ads.googleads.v0.services.FeedMappingService
- name: google.ads.googleads.v0.services.FeedService
- name: google.ads.googleads.v0.services.GenderViewService
- name: google.ads.googleads.v0.services.GeoTargetConstantService
- name: google.ads.googleads.v0.services.GoogleAdsFieldService
- name: google.ads.googleads.v0.services.SharedCriterionService
- name: google.ads.googleads.v0.services.SharedSetService
- name: google.ads.googleads.v0.services.UserListService
- name: google.ads.googleads.v0.services.GoogleAdsService
- name: google.ads.googleads.v0.services.HotelGroupViewService
- name: google.ads.googleads.v0.services.HotelPerformanceViewService
- name: google.ads.googleads.v0.services.KeywordPlanAdGroupService
- name: google.ads.googleads.v0.services.KeywordPlanCampaignService
- name: google.ads.googleads.v0.services.KeywordPlanIdeaService
- name: google.ads.googleads.v0.services.KeywordPlanKeywordService
- name: google.ads.googleads.v0.services.KeywordPlanNegativeKeywordService
- name: google.ads.googleads.v0.services.KeywordPlanService
- name: google.ads.googleads.v0.services.KeywordViewService
- name: google.ads.googleads.v0.services.LanguageConstantService
- name: google.ads.googleads.v0.services.ManagedPlacementViewService
- name: google.ads.googleads.v0.services.MediaFileService
- name: google.ads.googleads.v0.services.ParentalStatusViewService
- name: google.ads.googleads.v0.services.PaymentsAccountService
- name: google.ads.googleads.v0.services.ProductGroupViewService
- name: google.ads.googleads.v0.services.RecommendationService
- name: google.ads.googleads.v0.services.SearchTermViewService
- name: google.ads.googleads.v0.services.TopicConstantService
- name: google.ads.googleads.v0.services.TopicViewService
- name: google.ads.googleads.v0.services.UserInterestService
- name: google.ads.googleads.v0.services.VideoService
types:
- name: google.ads.googleads.v0.errors.GoogleAdsFailure
documentation:
summary: |-
Manage your AdWords accounts, campaigns, and reports with this REST-based
API.
overview: |-
# This warning always fires when the last path segment of packages is not
# the version
backend:
rules:
- selector: google.ads.googleads.v0.services.AccountBudgetProposalService.GetAccountBudgetProposal
deadline: 60.0
- selector: google.ads.googleads.v0.services.AccountBudgetProposalService.MutateAccountBudgetProposal
deadline: 60.0
- selector: google.ads.googleads.v0.services.AccountBudgetService.GetAccountBudget
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupAdService.GetAdGroupAd
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupAdService.MutateAdGroupAds
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupAudienceViewService.GetAdGroupAudienceView
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupBidModifierService.GetAdGroupBidModifier
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupBidModifierService.MutateAdGroupBidModifiers
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupCriterionService.GetAdGroupCriterion
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupCriterionService.MutateAdGroupCriteria
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupFeedService.GetAdGroupFeed
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupFeedService.MutateAdGroupFeeds
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupService.GetAdGroup
deadline: 60.0
- selector: google.ads.googleads.v0.services.AdGroupService.MutateAdGroups
deadline: 60.0
- selector: google.ads.googleads.v0.services.AgeRangeViewService.GetAgeRangeView
deadline: 60.0
- selector: google.ads.googleads.v0.services.BiddingStrategyService.GetBiddingStrategy
deadline: 60.0
- selector: google.ads.googleads.v0.services.BiddingStrategyService.MutateBiddingStrategies
deadline: 60.0
- selector: google.ads.googleads.v0.services.BillingSetupService.GetBillingSetup
deadline: 60.0
- selector: google.ads.googleads.v0.services.BillingSetupService.MutateBillingSetup
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignAudienceViewService.GetCampaignAudienceView
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignBidModifierService.GetCampaignBidModifier
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignBidModifierService.MutateCampaignBidModifiers
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignBudgetService.GetCampaignBudget
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignBudgetService.MutateCampaignBudgets
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignCriterionService.GetCampaignCriterion
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignCriterionService.MutateCampaignCriteria
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignFeedService.GetCampaignFeed
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignFeedService.MutateCampaignFeeds
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignGroupService.GetCampaignGroup
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignGroupService.MutateCampaignGroups
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignService.GetCampaign
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignService.MutateCampaigns
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignSharedSetService.GetCampaignSharedSet
deadline: 60.0
- selector: google.ads.googleads.v0.services.CampaignSharedSetService.MutateCampaignSharedSets
deadline: 60.0
- selector: google.ads.googleads.v0.services.CarrierConstantService.GetCarrierConstant
deadline: 60.0
- selector: google.ads.googleads.v0.services.ChangeStatusService.GetChangeStatus
deadline: 60.0
- selector: google.ads.googleads.v0.services.ConversionActionService.GetConversionAction
deadline: 60.0
- selector: google.ads.googleads.v0.services.ConversionActionService.MutateConversionActions
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerClientLinkService.GetCustomerClientLink
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerClientService.GetCustomerClient
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerFeedService.GetCustomerFeed
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerFeedService.MutateCustomerFeeds
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerManagerLinkService.GetCustomerManagerLink
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerService.GetCustomer
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerService.MutateCustomer
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerService.ListAccessibleCustomers
deadline: 60.0
- selector: google.ads.googleads.v0.services.CustomerService.CreateCustomerClient
deadline: 60.0
- selector: google.ads.googleads.v0.services.DisplayKeywordViewService.GetDisplayKeywordView
deadline: 60.0
- selector: google.ads.googleads.v0.services.FeedItemService.GetFeedItem
deadline: 60.0
- selector: google.ads.googleads.v0.services.FeedItemService.MutateFeedItems
deadline: 60.0
- selector: google.ads.googleads.v0.services.FeedMappingService.GetFeedMapping
deadline: 60.0
- selector: google.ads.googleads.v0.services.FeedMappingService.MutateFeedMappings
deadline: 60.0
- selector: google.ads.googleads.v0.services.FeedService.GetFeed
deadline: 60.0
- selector: google.ads.googleads.v0.services.FeedService.MutateFeeds
deadline: 60.0
- selector: google.ads.googleads.v0.services.GenderViewService.GetGenderView
deadline: 60.0
- selector: google.ads.googleads.v0.services.GeoTargetConstantService.GetGeoTargetConstant
deadline: 60.0
- selector: google.ads.googleads.v0.services.GeoTargetConstantService.SuggestGeoTargetConstants
deadline: 60.0
- selector: google.ads.googleads.v0.services.GoogleAdsFieldService.GetGoogleAdsField
deadline: 600.0
- selector: google.ads.googleads.v0.services.GoogleAdsFieldService.SearchGoogleAdsFields
deadline: 600.0
- selector: google.ads.googleads.v0.services.SharedCriterionService.GetSharedCriterion
deadline: 60.0
- selector: google.ads.googleads.v0.services.SharedCriterionService.MutateSharedCriteria
deadline: 60.0
- selector: google.ads.googleads.v0.services.SharedSetService.GetSharedSet
deadline: 60.0
- selector: google.ads.googleads.v0.services.SharedSetService.MutateSharedSets
deadline: 60.0
- selector: google.ads.googleads.v0.services.UserListService.GetUserList
deadline: 60.0
- selector: google.ads.googleads.v0.services.UserListService.MutateUserLists
deadline: 60.0
- selector: google.ads.googleads.v0.services.GoogleAdsService.Search
deadline: 600.0
- selector: google.ads.googleads.v0.services.GoogleAdsService.Mutate
deadline: 600.0
- selector: google.ads.googleads.v0.services.HotelGroupViewService.GetHotelGroupView
deadline: 60.0
- selector: google.ads.googleads.v0.services.HotelPerformanceViewService.GetHotelPerformanceView
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanAdGroupService.GetKeywordPlanAdGroup
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanAdGroupService.MutateKeywordPlanAdGroups
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanCampaignService.GetKeywordPlanCampaign
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanCampaignService.MutateKeywordPlanCampaigns
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanIdeaService.GenerateKeywordIdeas
deadline: 600.0
- selector: google.ads.googleads.v0.services.KeywordPlanKeywordService.GetKeywordPlanKeyword
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanKeywordService.MutateKeywordPlanKeywords
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanNegativeKeywordService.GetKeywordPlanNegativeKeyword
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanNegativeKeywordService.MutateKeywordPlanNegativeKeywords
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanService.GetKeywordPlan
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanService.MutateKeywordPlans
deadline: 60.0
- selector: google.ads.googleads.v0.services.KeywordPlanService.GenerateForecastMetrics
deadline: 600.0
- selector: google.ads.googleads.v0.services.KeywordPlanService.GenerateHistoricalMetrics
deadline: 600.0
- selector: google.ads.googleads.v0.services.KeywordViewService.GetKeywordView
deadline: 60.0
- selector: google.ads.googleads.v0.services.LanguageConstantService.GetLanguageConstant
deadline: 60.0
- selector: google.ads.googleads.v0.services.ManagedPlacementViewService.GetManagedPlacementView
deadline: 60.0
- selector: google.ads.googleads.v0.services.MediaFileService.GetMediaFile
deadline: 60.0
- selector: google.ads.googleads.v0.services.MediaFileService.MutateMediaFiles
deadline: 60.0
- selector: google.ads.googleads.v0.services.ParentalStatusViewService.GetParentalStatusView
deadline: 60.0
- selector: google.ads.googleads.v0.services.PaymentsAccountService.ListPaymentsAccounts
deadline: 60.0
- selector: google.ads.googleads.v0.services.ProductGroupViewService.GetProductGroupView
deadline: 60.0
- selector: google.ads.googleads.v0.services.RecommendationService.GetRecommendation
deadline: 600.0
- selector: google.ads.googleads.v0.services.RecommendationService.ApplyRecommendation
deadline: 600.0
- selector: google.ads.googleads.v0.services.RecommendationService.DismissRecommendation
deadline: 600.0
- selector: google.ads.googleads.v0.services.SearchTermViewService.GetSearchTermView
deadline: 60.0
- selector: google.ads.googleads.v0.services.TopicConstantService.GetTopicConstant
deadline: 60.0
- selector: google.ads.googleads.v0.services.TopicViewService.GetTopicView
deadline: 60.0
- selector: google.ads.googleads.v0.services.UserInterestService.GetUserInterest
deadline: 60.0
- selector: google.ads.googleads.v0.services.VideoService.GetVideo
deadline: 60.0

@ -1,63 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/served_asset_field_type.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "AdAssetProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing assets used inside an ad.
// A text asset used inside an ad.
message AdTextAsset {
// Asset text.
google.protobuf.StringValue text = 1;
// The pinned field of the asset. This restricts the asset to only serve
// within this field. Multiple assets can be pinned to the same field. An
// asset that is unpinned or pinned to a different field will not serve in a
// field where some other asset has been pinned.
google.ads.googleads.v1.enums.ServedAssetFieldTypeEnum.ServedAssetFieldType pinned_field = 2;
}
// An image asset used inside an ad.
message AdImageAsset {
// The Asset resource name of this image.
google.protobuf.StringValue asset = 1;
}
// A video asset used inside an ad.
message AdVideoAsset {
// The Asset resource name of this video.
google.protobuf.StringValue asset = 1;
}
// A media bundle asset used inside an ad.
message AdMediaBundleAsset {
// The Asset resource name of this media bundle.
google.protobuf.StringValue asset = 1;
}

@ -1,571 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/common/ad_asset.proto";
import "google/ads/googleads/v1/enums/call_conversion_reporting_state.proto";
import "google/ads/googleads/v1/enums/display_ad_format_setting.proto";
import "google/ads/googleads/v1/enums/display_upload_product_type.proto";
import "google/ads/googleads/v1/enums/legacy_app_install_ad_app_store.proto";
import "google/ads/googleads/v1/enums/mime_type.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "AdTypeInfosProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file containing info messages for specific ad types.
// A text ad.
message TextAdInfo {
// The headline of the ad.
google.protobuf.StringValue headline = 1;
// The first line of the ad's description.
google.protobuf.StringValue description1 = 2;
// The second line of the ad's description.
google.protobuf.StringValue description2 = 3;
}
// An expanded text ad.
message ExpandedTextAdInfo {
// The first part of the ad's headline.
google.protobuf.StringValue headline_part1 = 1;
// The second part of the ad's headline.
google.protobuf.StringValue headline_part2 = 2;
// The third part of the ad's headline.
google.protobuf.StringValue headline_part3 = 6;
// The description of the ad.
google.protobuf.StringValue description = 3;
// The second description of the ad.
google.protobuf.StringValue description2 = 7;
// The text that can appear alongside the ad's displayed URL.
google.protobuf.StringValue path1 = 4;
// Additional text that can appear alongside the ad's displayed URL.
google.protobuf.StringValue path2 = 5;
}
// A call-only ad.
message CallOnlyAdInfo {
// The country code in the ad.
google.protobuf.StringValue country_code = 1;
// The phone number in the ad.
google.protobuf.StringValue phone_number = 2;
// The business name in the ad.
google.protobuf.StringValue business_name = 3;
// First headline in the ad.
google.protobuf.StringValue headline1 = 11;
// Second headline in the ad.
google.protobuf.StringValue headline2 = 12;
// The first line of the ad's description.
google.protobuf.StringValue description1 = 4;
// The second line of the ad's description.
google.protobuf.StringValue description2 = 5;
// Whether to enable call tracking for the creative. Enabling call
// tracking also enables call conversions.
google.protobuf.BoolValue call_tracked = 6;
// Whether to disable call conversion for the creative.
// If set to `true`, disables call conversions even when `call_tracked` is
// `true`.
// If `call_tracked` is `false`, this field is ignored.
google.protobuf.BoolValue disable_call_conversion = 7;
// The URL to be used for phone number verification.
google.protobuf.StringValue phone_number_verification_url = 8;
// The conversion action to attribute a call conversion to. If not set a
// default conversion action is used. This field only has effect if
// call_tracked is set to true. Otherwise this field is ignored.
google.protobuf.StringValue conversion_action = 9;
// The call conversion behavior of this call only ad. It can use its own call
// conversion setting, inherit the account level setting, or be disabled.
google.ads.googleads.v1.enums.CallConversionReportingStateEnum.CallConversionReportingState conversion_reporting_state = 10;
}
// An expanded dynamic search ad.
message ExpandedDynamicSearchAdInfo {
// The description of the ad.
google.protobuf.StringValue description = 1;
}
// A hotel ad.
message HotelAdInfo {
}
// A Smart Shopping ad.
message ShoppingSmartAdInfo {
}
// A standard Shopping ad.
message ShoppingProductAdInfo {
}
// A Gmail ad.
message GmailAdInfo {
// The Gmail teaser.
GmailTeaser teaser = 1;
// The MediaFile resource name of the header image. Valid image types are GIF,
// JPEG and PNG. The minimum size is 300x100 pixels and the aspect ratio must
// be between 3:1 and 5:1 (+-1%).
google.protobuf.StringValue header_image = 2;
// The MediaFile resource name of the marketing image. Valid image types are
// GIF, JPEG and PNG. The image must either be landscape with a minimum size
// of 600x314 pixels and aspect ratio of 600:314 (+-1%) or square with a
// minimum size of 300x300 pixels and aspect ratio of 1:1 (+-1%)
google.protobuf.StringValue marketing_image = 3;
// Headline of the marketing image.
google.protobuf.StringValue marketing_image_headline = 4;
// Description of the marketing image.
google.protobuf.StringValue marketing_image_description = 5;
// Display-call-to-action of the marketing image.
DisplayCallToAction marketing_image_display_call_to_action = 6;
// Product images. Up to 15 images are supported.
repeated ProductImage product_images = 7;
// Product videos. Up to 7 videos are supported. At least one product video
// or a marketing image must be specified.
repeated ProductVideo product_videos = 8;
}
// Gmail teaser data. The teaser is a small header that acts as an invitation
// to view the rest of the ad (the body).
message GmailTeaser {
// Headline of the teaser.
google.protobuf.StringValue headline = 1;
// Description of the teaser.
google.protobuf.StringValue description = 2;
// Business name of the advertiser.
google.protobuf.StringValue business_name = 3;
// The MediaFile resource name of the logo image. Valid image types are GIF,
// JPEG and PNG. The minimum size is 144x144 pixels and the aspect ratio must
// be 1:1 (+-1%).
google.protobuf.StringValue logo_image = 4;
}
// Data for display call to action. The call to action is a piece of the ad
// that prompts the user to do something. Like clicking a link or making a phone
// call.
message DisplayCallToAction {
// Text for the display-call-to-action.
google.protobuf.StringValue text = 1;
// Text color for the display-call-to-action in hexadecimal, e.g. #ffffff for
// white.
google.protobuf.StringValue text_color = 2;
// Identifies the url collection in the ad.url_collections field. If not set
// the url defaults to final_url.
google.protobuf.StringValue url_collection_id = 3;
}
// Product image specific data.
message ProductImage {
// The MediaFile resource name of the product image. Valid image types are
// GIF, JPEG and PNG. The minimum size is 300x300 pixels and the aspect ratio
// must be 1:1 (+-1%).
google.protobuf.StringValue product_image = 1;
// Description of the product.
google.protobuf.StringValue description = 2;
// Display-call-to-action of the product image.
DisplayCallToAction display_call_to_action = 3;
}
// Product video specific data.
message ProductVideo {
// The MediaFile resource name of a video which must be hosted on YouTube.
google.protobuf.StringValue product_video = 1;
}
// An image ad.
message ImageAdInfo {
// Width in pixels of the full size image.
google.protobuf.Int64Value pixel_width = 4;
// Height in pixels of the full size image.
google.protobuf.Int64Value pixel_height = 5;
// URL of the full size image.
google.protobuf.StringValue image_url = 6;
// Width in pixels of the preview size image.
google.protobuf.Int64Value preview_pixel_width = 7;
// Height in pixels of the preview size image.
google.protobuf.Int64Value preview_pixel_height = 8;
// URL of the preview size image.
google.protobuf.StringValue preview_image_url = 9;
// The mime type of the image.
google.ads.googleads.v1.enums.MimeTypeEnum.MimeType mime_type = 10;
// The name of the image. If the image was created from a MediaFile, this is
// the MediaFile's name. If the image was created from bytes, this is empty.
google.protobuf.StringValue name = 11;
// The image to create the ImageAd from. This can be specified in one of
// two ways.
// 1. An existing MediaFile resource.
// 2. The raw image data as bytes.
oneof image {
// The MediaFile resource to use for the image.
google.protobuf.StringValue media_file = 1;
// Raw image data as bytes.
google.protobuf.BytesValue data = 2;
// An ad ID to copy the image from.
google.protobuf.Int64Value ad_id_to_copy_image_from = 3;
}
}
// Representation of video bumper in-stream ad format (very short in-stream
// non-skippable video ad).
message VideoBumperInStreamAdInfo {
}
// Representation of video non-skippable in-stream ad format (15 second
// in-stream non-skippable video ad).
message VideoNonSkippableInStreamAdInfo {
}
// Representation of video TrueView in-stream ad format (ad shown during video
// playback, often at beginning, which displays a skip button a few seconds into
// the video).
message VideoTrueViewInStreamAdInfo {
// Label on the CTA (call-to-action) button taking the user to the video ad's
// final URL.
// Required for TrueView for action campaigns, optional otherwise.
google.protobuf.StringValue action_button_label = 1;
// Additional text displayed with the CTA (call-to-action) button to give
// context and encourage clicking on the button.
google.protobuf.StringValue action_headline = 2;
// The MediaFile resource name of the companion banner used with the ad.
google.protobuf.StringValue companion_banner = 3;
}
// Representation of video out-stream ad format (ad shown alongside a feed
// with automatic playback, without sound).
message VideoOutstreamAdInfo {
// The headline of the ad.
google.protobuf.StringValue headline = 1;
// The description line.
google.protobuf.StringValue description = 2;
}
// A video ad.
message VideoAdInfo {
// The MediaFile resource to use for the video.
google.protobuf.StringValue media_file = 1;
// Format-specific schema for the different video formats.
oneof format {
// Video TrueView in-stream ad format.
VideoTrueViewInStreamAdInfo in_stream = 2;
// Video bumper in-stream ad format.
VideoBumperInStreamAdInfo bumper = 3;
// Video out-stream ad format.
VideoOutstreamAdInfo out_stream = 4;
// Video non-skippable in-stream ad format.
VideoNonSkippableInStreamAdInfo non_skippable = 5;
}
}
// A responsive search ad.
//
// Responsive search ads let you create an ad that adapts to show more text, and
// more relevant messages, to your customers. Enter multiple headlines and
// descriptions when creating a responsive search ad, and over time, Google Ads
// will automatically test different combinations and learn which combinations
// perform best. By adapting your ad's content to more closely match potential
// customers' search terms, responsive search ads may improve your campaign's
// performance.
//
// More information at https://support.google.com/google-ads/answer/7684791
message ResponsiveSearchAdInfo {
// List of text assets for headlines. When the ad serves the headlines will
// be selected from this list.
repeated AdTextAsset headlines = 1;
// List of text assets for descriptions. When the ad serves the descriptions
// will be selected from this list.
repeated AdTextAsset descriptions = 2;
// First part of text that may appear appended to the url displayed in the ad.
google.protobuf.StringValue path1 = 3;
// Second part of text that may appear appended to the url displayed in the
// ad. This field can only be set when path1 is also set.
google.protobuf.StringValue path2 = 4;
}
// A legacy responsive display ad. Ads of this type are labeled 'Responsive ads'
// in the Google Ads UI.
message LegacyResponsiveDisplayAdInfo {
// The short version of the ad's headline.
google.protobuf.StringValue short_headline = 1;
// The long version of the ad's headline.
google.protobuf.StringValue long_headline = 2;
// The description of the ad.
google.protobuf.StringValue description = 3;
// The business name in the ad.
google.protobuf.StringValue business_name = 4;
// Advertiser's consent to allow flexible color. When true, the ad may be
// served with different color if necessary. When false, the ad will be served
// with the specified colors or a neutral color.
// The default value is true.
// Must be true if main_color and accent_color are not set.
google.protobuf.BoolValue allow_flexible_color = 5;
// The accent color of the ad in hexadecimal, e.g. #ffffff for white.
// If one of main_color and accent_color is set, the other is required as
// well.
google.protobuf.StringValue accent_color = 6;
// The main color of the ad in hexadecimal, e.g. #ffffff for white.
// If one of main_color and accent_color is set, the other is required as
// well.
google.protobuf.StringValue main_color = 7;
// The call-to-action text for the ad.
google.protobuf.StringValue call_to_action_text = 8;
// The MediaFile resource name of the logo image used in the ad.
google.protobuf.StringValue logo_image = 9;
// The MediaFile resource name of the square logo image used in the ad.
google.protobuf.StringValue square_logo_image = 10;
// The MediaFile resource name of the marketing image used in the ad.
google.protobuf.StringValue marketing_image = 11;
// The MediaFile resource name of the square marketing image used in the ad.
google.protobuf.StringValue square_marketing_image = 12;
// Specifies which format the ad will be served in. Default is ALL_FORMATS.
google.ads.googleads.v1.enums.DisplayAdFormatSettingEnum.DisplayAdFormatSetting format_setting = 13;
// Prefix before price. E.g. 'as low as'.
google.protobuf.StringValue price_prefix = 14;
// Promotion text used for dyanmic formats of responsive ads. For example
// 'Free two-day shipping'.
google.protobuf.StringValue promo_text = 15;
}
// An app ad.
message AppAdInfo {
// An optional text asset that, if specified, must always be displayed when
// the ad is served.
AdTextAsset mandatory_ad_text = 1;
// List of text assets for headlines. When the ad serves the headlines will
// be selected from this list.
repeated AdTextAsset headlines = 2;
// List of text assets for descriptions. When the ad serves the descriptions
// will be selected from this list.
repeated AdTextAsset descriptions = 3;
// List of image assets that may be displayed with the ad.
repeated AdImageAsset images = 4;
// List of YouTube video assets that may be displayed with the ad.
repeated AdVideoAsset youtube_videos = 5;
// List of media bundle assets that may be used with the ad.
repeated AdMediaBundleAsset html5_media_bundles = 6;
}
// App engagement ads allow you to write text encouraging a specific action in
// the app, like checking in, making a purchase, or booking a flight.
// They allow you to send users to a specific part of your app where they can
// find what they're looking for easier and faster.
message AppEngagementAdInfo {
// List of text assets for headlines. When the ad serves the headlines will
// be selected from this list.
repeated AdTextAsset headlines = 1;
// List of text assets for descriptions. When the ad serves the descriptions
// will be selected from this list.
repeated AdTextAsset descriptions = 2;
// List of image assets that may be displayed with the ad.
repeated AdImageAsset images = 3;
// List of video assets that may be displayed with the ad.
repeated AdVideoAsset videos = 4;
}
// A legacy app install ad that only can be used by a few select customers.
message LegacyAppInstallAdInfo {
// The id of the mobile app.
google.protobuf.StringValue app_id = 1;
// The app store the mobile app is available in.
google.ads.googleads.v1.enums.LegacyAppInstallAdAppStoreEnum.LegacyAppInstallAdAppStore app_store = 2;
// The headline of the ad.
google.protobuf.StringValue headline = 3;
// The first description line of the ad.
google.protobuf.StringValue description1 = 4;
// The second description line of the ad.
google.protobuf.StringValue description2 = 5;
}
// A responsive display ad.
message ResponsiveDisplayAdInfo {
// Marketing images to be used in the ad. Valid image types are GIF,
// JPEG, and PNG. The minimum size is 600x314 and the aspect ratio must
// be 1.91:1 (+-1%). At least one marketing_image is required. Combined with
// square_marketing_images the maximum is 15.
repeated AdImageAsset marketing_images = 1;
// Square marketing images to be used in the ad. Valid image types are GIF,
// JPEG, and PNG. The minimum size is 300x300 and the aspect ratio must
// be 1:1 (+-1%). At least one square marketing_image is required. Combined
// with marketing_images the maximum is 15.
repeated AdImageAsset square_marketing_images = 2;
// Logo images to be used in the ad. Valid image types are GIF,
// JPEG, and PNG. The minimum size is 512x128 and the aspect ratio must
// be 4:1 (+-1%). Combined with square_logo_images the maximum is 5.
repeated AdImageAsset logo_images = 3;
// Square logo images to be used in the ad. Valid image types are GIF,
// JPEG, and PNG. The minimum size is 128x128 and the aspect ratio must
// be 1:1 (+-1%). Combined with square_logo_images the maximum is 5.
repeated AdImageAsset square_logo_images = 4;
// Short format headlines for the ad. The maximum length is 30 characters.
// At least 1 and max 5 headlines can be specified.
repeated AdTextAsset headlines = 5;
// A required long format headline. The maximum length is 90 characters.
AdTextAsset long_headline = 6;
// Descriptive texts for the ad. The maximum length is 90 characters. At
// least 1 and max 5 headlines can be specified.
repeated AdTextAsset descriptions = 7;
// Optional YouTube vidoes for the ad. A maximum of 5 videos can be specified.
repeated AdVideoAsset youtube_videos = 8;
// The advertiser/brand name. Maximum display width is 25.
google.protobuf.StringValue business_name = 9;
// The main color of the ad in hexadecimal, e.g. #ffffff for white.
// If one of main_color and accent_color is set, the other is required as
// well.
google.protobuf.StringValue main_color = 10;
// The accent color of the ad in hexadecimal, e.g. #ffffff for white.
// If one of main_color and accent_color is set, the other is required as
// well.
google.protobuf.StringValue accent_color = 11;
// Advertiser's consent to allow flexible color. When true, the ad may be
// served with different color if necessary. When false, the ad will be served
// with the specified colors or a neutral color.
// The default value is true.
// Must be true if main_color and accent_color are not set.
google.protobuf.BoolValue allow_flexible_color = 12;
// The call-to-action text for the ad. Maximum display width is 30.
google.protobuf.StringValue call_to_action_text = 13;
// Prefix before price. E.g. 'as low as'.
google.protobuf.StringValue price_prefix = 14;
// Promotion text used for dyanmic formats of responsive ads. For example
// 'Free two-day shipping'.
google.protobuf.StringValue promo_text = 15;
// Specifies which format the ad will be served in. Default is ALL_FORMATS.
google.ads.googleads.v1.enums.DisplayAdFormatSettingEnum.DisplayAdFormatSetting format_setting = 16;
}
// A generic type of display ad. The exact ad format is controlled by the
// display_upload_product_type field, which determines what kinds of data
// need to be included with the ad.
message DisplayUploadAdInfo {
// The product type of this ad. See comments on the enum for details.
google.ads.googleads.v1.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType display_upload_product_type = 1;
// The asset data that makes up the ad.
oneof media_asset {
// A media bundle asset to be used in the ad. For information about the
// media bundle for HTML5_UPLOAD_AD see
// https://support.google.com/google-ads/answer/1722096
// Media bundles that are part of dynamic product types use a special format
// that needs to be created through the Google Web Designer. See
// https://support.google.com/webdesigner/answer/7543898 for more
// information.
AdMediaBundleAsset media_bundle = 2;
}
}

@ -1,82 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/mime_type.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "AssetTypesProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file containing info messages for specific asset types.
// A YouTube asset.
message YoutubeVideoAsset {
// YouTube video id. This is the 11 character string value used in the
// YouTube video URL.
google.protobuf.StringValue youtube_video_id = 1;
}
// A MediaBundle asset.
message MediaBundleAsset {
// Media bundle (ZIP file) asset data. The format of the uploaded ZIP file
// depends on the ad field where it will be used. For more information on the
// format, see the documentation of the ad field where you plan on using the
// MediaBundleAsset. This field is mutate only.
google.protobuf.BytesValue data = 1;
}
// An Image asset.
message ImageAsset {
// The raw bytes data of an image. This field is mutate only.
google.protobuf.BytesValue data = 1;
// File size of the image asset in bytes.
google.protobuf.Int64Value file_size = 2;
// MIME type of the image asset.
google.ads.googleads.v1.enums.MimeTypeEnum.MimeType mime_type = 3;
// Metadata for this image at its original size.
ImageDimension full_size = 4;
}
// Metadata for an image at a certain size, either original or resized.
message ImageDimension {
// Height of the image.
google.protobuf.Int64Value height_pixels = 1;
// Width of the image.
google.protobuf.Int64Value width_pixels = 2;
// A URL that returns the image with this height and width.
google.protobuf.StringValue url = 3;
}
// A Text asset.
message TextAsset {
// Text content of the text asset.
google.protobuf.StringValue text = 1;
}

@ -1,232 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/page_one_promoted_strategy_goal.proto";
import "google/ads/googleads/v1/enums/target_impression_share_location.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "BiddingProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing bidding schemes.
// Commission is an automatic bidding strategy in which the advertiser pays a
// certain portion of the conversion value.
message Commission {
// Commission rate defines the portion of the conversion value that the
// advertiser will be billed. A commission rate of x should be passed into
// this field as (x * 1,000,000). For example, 106,000 represents a commission
// rate of 0.106 (10.6%).
google.protobuf.Int64Value commission_rate_micros = 1;
}
// An automated bidding strategy that raises bids for clicks
// that seem more likely to lead to a conversion and lowers
// them for clicks where they seem less likely.
message EnhancedCpc {
}
// Manual click-based bidding where user pays per click.
message ManualCpc {
// Whether bids are to be enhanced based on conversion optimizer data.
google.protobuf.BoolValue enhanced_cpc_enabled = 1;
}
// Manual impression-based bidding where user pays per thousand impressions.
message ManualCpm {
}
// View based bidding where user pays per video view.
message ManualCpv {
}
// An automated bidding strategy that sets bids to help get the most conversions
// for your campaign while spending your budget.
message MaximizeConversions {
}
// An automated bidding strategy which tries to maximize conversion value
// given a daily budget.
message MaximizeConversionValue {
// The target return on ad spend (ROAS) option. If set, the bid strategy will
// maximize revenue while averaging the target return on ad spend. If the
// target ROAS is high, the bid strategy may not be able to spend the full
// budget. If the target ROAS is not set, the bid strategy will aim to
// achieve the highest possible ROAS for the budget.
google.protobuf.DoubleValue target_roas = 1;
}
// An automated bidding strategy which sets CPC bids to target impressions on
// page one, or page one promoted slots on google.com.
message PageOnePromoted {
// The strategy goal of where impressions are desired to be shown on
// search result pages.
google.ads.googleads.v1.enums.PageOnePromotedStrategyGoalEnum.PageOnePromotedStrategyGoal strategy_goal = 1;
// Maximum bid limit that can be set by the bid strategy.
// The limit applies to all keywords managed by the strategy.
google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;
// Bid multiplier to be applied to the relevant bid estimate (depending on
// the `strategy_goal`) in determining a keyword's new CPC bid.
google.protobuf.DoubleValue bid_modifier = 3;
// Whether the strategy should always follow bid estimate changes, or only
// increase.
// If false, always sets a keyword's new bid to the current bid estimate.
// If true, only updates a keyword's bid if the current bid estimate is
// greater than the current bid.
google.protobuf.BoolValue only_raise_cpc_bids = 4;
// Whether the strategy is allowed to raise bids when the throttling
// rate of the budget it is serving out of rises above a threshold.
google.protobuf.BoolValue raise_cpc_bid_when_budget_constrained = 5;
// Whether the strategy is allowed to raise bids on keywords with
// lower-range quality scores.
google.protobuf.BoolValue raise_cpc_bid_when_quality_score_is_low = 6;
}
// An automated bid strategy that sets bids to help get as many conversions as
// possible at the target cost-per-acquisition (CPA) you set.
message TargetCpa {
// Average CPA target.
// This target should be greater than or equal to minimum billable unit based
// on the currency for the account.
google.protobuf.Int64Value target_cpa_micros = 1;
// Maximum bid limit that can be set by the bid strategy.
// The limit applies to all keywords managed by the strategy.
google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;
// Minimum bid limit that can be set by the bid strategy.
// The limit applies to all keywords managed by the strategy.
google.protobuf.Int64Value cpc_bid_floor_micros = 3;
}
// Target CPM (cost per thousand impressions) is an automated bidding strategy
// that sets bids to optimize performance given the target CPM you set.
message TargetCpm {
}
// An automated bidding strategy that sets bids so that a certain percentage of
// search ads are shown at the top of the first page (or other targeted
// location).
// Next Id = 4
message TargetImpressionShare {
// The targeted location on the search results page.
google.ads.googleads.v1.enums.TargetImpressionShareLocationEnum.TargetImpressionShareLocation location = 1;
// The desired fraction of ads to be shown in the targeted location in micros.
// E.g. 1% equals 10,000.
google.protobuf.Int64Value location_fraction_micros = 2;
// The highest CPC bid the automated bidding system is permitted to specify.
// This is a required field entered by the advertiser that sets the ceiling
// and specified in local micros.
google.protobuf.Int64Value cpc_bid_ceiling_micros = 3;
}
// An automated bidding strategy that sets bids based on the target fraction of
// auctions where the advertiser should outrank a specific competitor.
message TargetOutrankShare {
// The target fraction of auctions where the advertiser should outrank the
// competitor.
// The advertiser outranks the competitor in an auction if either the
// advertiser appears above the competitor in the search results, or appears
// in the search results when the competitor does not.
// Value must be between 1 and 1000000, inclusive.
google.protobuf.Int32Value target_outrank_share_micros = 1;
// Competitor's visible domain URL.
google.protobuf.StringValue competitor_domain = 2;
// Maximum bid limit that can be set by the bid strategy.
// The limit applies to all keywords managed by the strategy.
google.protobuf.Int64Value cpc_bid_ceiling_micros = 3;
// Whether the strategy should always follow bid estimate changes,
// or only increase.
// If false, always set a keyword's new bid to the current bid estimate.
// If true, only updates a keyword's bid if the current bid estimate is
// greater than the current bid.
google.protobuf.BoolValue only_raise_cpc_bids = 4;
// Whether the strategy is allowed to raise bids on keywords with
// lower-range quality scores.
google.protobuf.BoolValue raise_cpc_bid_when_quality_score_is_low = 5;
}
// An automated bidding strategy that helps you maximize revenue while
// averaging a specific target return on ad spend (ROAS).
message TargetRoas {
// Required. The desired revenue (based on conversion data) per unit of spend.
// Value must be between 0.01 and 1000.0, inclusive.
google.protobuf.DoubleValue target_roas = 1;
// Maximum bid limit that can be set by the bid strategy.
// The limit applies to all keywords managed by the strategy.
google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;
// Minimum bid limit that can be set by the bid strategy.
// The limit applies to all keywords managed by the strategy.
google.protobuf.Int64Value cpc_bid_floor_micros = 3;
}
// An automated bid strategy that sets your bids to help get as many clicks
// as possible within your budget.
message TargetSpend {
// The spend target under which to maximize clicks.
// A TargetSpend bidder will attempt to spend the smaller of this value
// or the natural throttling spend amount.
// If not specified, the budget is used as the spend target.
google.protobuf.Int64Value target_spend_micros = 1;
// Maximum bid limit that can be set by the bid strategy.
// The limit applies to all keywords managed by the strategy.
google.protobuf.Int64Value cpc_bid_ceiling_micros = 2;
}
// A bidding strategy where bids are a fraction of the advertised price for
// some good or service.
message PercentCpc {
// Maximum bid limit that can be set by the bid strategy. This is
// an optional field entered by the advertiser and specified in local micros.
// Note: A zero value is interpreted in the same way as having bid_ceiling
// undefined.
google.protobuf.Int64Value cpc_bid_ceiling_micros = 1;
// Adjusts the bid for each auction upward or downward, depending on the
// likelihood of a conversion. Individual bids may exceed
// cpc_bid_ceiling_micros, but the average bid amount for a campaign should
// not.
google.protobuf.BoolValue enhanced_cpc_enabled = 2;
}

@ -1,50 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "ClickLocationProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing a ClickLocation.
// Location criteria associated with a click.
message ClickLocation {
// The city location criterion associated with the impression.
google.protobuf.StringValue city = 1;
// The country location criterion associated with the impression.
google.protobuf.StringValue country = 2;
// The metro location criterion associated with the impression.
google.protobuf.StringValue metro = 3;
// The most specific location criterion associated with the impression.
google.protobuf.StringValue most_specific = 4;
// The region location criterion associated with the impression.
google.protobuf.StringValue region = 5;
}

@ -1,594 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/age_range_type.proto";
import "google/ads/googleads/v1/enums/app_payment_model_type.proto";
import "google/ads/googleads/v1/enums/content_label_type.proto";
import "google/ads/googleads/v1/enums/day_of_week.proto";
import "google/ads/googleads/v1/enums/device.proto";
import "google/ads/googleads/v1/enums/gender_type.proto";
import "google/ads/googleads/v1/enums/hotel_date_selection_type.proto";
import "google/ads/googleads/v1/enums/income_range_type.proto";
import "google/ads/googleads/v1/enums/interaction_type.proto";
import "google/ads/googleads/v1/enums/keyword_match_type.proto";
import "google/ads/googleads/v1/enums/listing_custom_attribute_index.proto";
import "google/ads/googleads/v1/enums/listing_group_type.proto";
import "google/ads/googleads/v1/enums/location_group_radius_units.proto";
import "google/ads/googleads/v1/enums/minute_of_hour.proto";
import "google/ads/googleads/v1/enums/parental_status_type.proto";
import "google/ads/googleads/v1/enums/preferred_content_type.proto";
import "google/ads/googleads/v1/enums/product_bidding_category_level.proto";
import "google/ads/googleads/v1/enums/product_channel.proto";
import "google/ads/googleads/v1/enums/product_channel_exclusivity.proto";
import "google/ads/googleads/v1/enums/product_condition.proto";
import "google/ads/googleads/v1/enums/product_type_level.proto";
import "google/ads/googleads/v1/enums/proximity_radius_units.proto";
import "google/ads/googleads/v1/enums/webpage_condition_operand.proto";
import "google/ads/googleads/v1/enums/webpage_condition_operator.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "CriteriaProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing criteria types.
// A keyword criterion.
message KeywordInfo {
// The text of the keyword (at most 80 characters and 10 words).
google.protobuf.StringValue text = 1;
// The match type of the keyword.
google.ads.googleads.v1.enums.KeywordMatchTypeEnum.KeywordMatchType match_type = 2;
}
// A placement criterion. This can be used to modify bids for sites when
// targeting the content network.
message PlacementInfo {
// URL of the placement.
//
// For example, "http://www.domain.com".
google.protobuf.StringValue url = 1;
}
// A mobile app category criterion.
message MobileAppCategoryInfo {
// The mobile app category constant resource name.
google.protobuf.StringValue mobile_app_category_constant = 1;
}
// A mobile application criterion.
message MobileApplicationInfo {
// A string that uniquely identifies a mobile application to Google Ads API.
// The format of this string is "{platform}-{platform_native_id}", where
// platform is "1" for iOS apps and "2" for Android apps, and where
// platform_native_id is the mobile application identifier native to the
// corresponding platform.
// For iOS, this native identifier is the 9 digit string that appears at the
// end of an App Store URL (e.g., "476943146" for "Flood-It! 2" whose App
// Store link is http://itunes.apple.com/us/app/flood-it!-2/id476943146).
// For Android, this native identifier is the application's package name
// (e.g., "com.labpixies.colordrips" for "Color Drips" given Google Play link
// https://play.google.com/store/apps/details?id=com.labpixies.colordrips).
// A well formed app id for Google Ads API would thus be "1-476943146" for iOS
// and "2-com.labpixies.colordrips" for Android.
// This field is required and must be set in CREATE operations.
google.protobuf.StringValue app_id = 2;
// Name of this mobile application.
google.protobuf.StringValue name = 3;
}
// A location criterion.
message LocationInfo {
// The geo target constant resource name.
google.protobuf.StringValue geo_target_constant = 1;
}
// A device criterion.
message DeviceInfo {
// Type of the device.
google.ads.googleads.v1.enums.DeviceEnum.Device type = 1;
}
// A preferred content criterion.
message PreferredContentInfo {
// Type of the preferred content.
google.ads.googleads.v1.enums.PreferredContentTypeEnum.PreferredContentType type = 2;
}
// A listing group criterion.
message ListingGroupInfo {
// Type of the listing group.
google.ads.googleads.v1.enums.ListingGroupTypeEnum.ListingGroupType type = 1;
// Dimension value with which this listing group is refining its parent.
// Undefined for the root group.
ListingDimensionInfo case_value = 2;
// Resource name of ad group criterion which is the parent listing group
// subdivision. Null for the root group.
google.protobuf.StringValue parent_ad_group_criterion = 3;
}
// A listing scope criterion.
message ListingScopeInfo {
// Scope of the campaign criterion.
repeated ListingDimensionInfo dimensions = 2;
}
// Listing dimensions for listing group criterion.
message ListingDimensionInfo {
// Dimension of one of the types below is always present.
oneof dimension {
// Brand of the listing.
ListingBrandInfo listing_brand = 1;
// Advertiser-specific hotel ID.
HotelIdInfo hotel_id = 2;
// Class of the hotel as a number of stars 1 to 5.
HotelClassInfo hotel_class = 3;
// Country or Region the hotel is located in.
HotelCountryRegionInfo hotel_country_region = 4;
// State the hotel is located in.
HotelStateInfo hotel_state = 5;
// City the hotel is located in.
HotelCityInfo hotel_city = 6;
// Listing custom attribute.
ListingCustomAttributeInfo listing_custom_attribute = 7;
// Bidding category of a product offer.
ProductBiddingCategoryInfo product_bidding_category = 13;
// Locality of a product offer.
ProductChannelInfo product_channel = 8;
// Availability of a product offer.
ProductChannelExclusivityInfo product_channel_exclusivity = 9;
// Condition of a product offer.
ProductConditionInfo product_condition = 10;
// Item id of a product offer.
ProductItemIdInfo product_item_id = 11;
// Type of a product offer.
ProductTypeInfo product_type = 12;
// Unknown dimension. Set when no other listing dimension is set.
UnknownListingDimensionInfo unknown_listing_dimension = 14;
}
}
// Brand of the listing.
message ListingBrandInfo {
// String value of the listing brand.
google.protobuf.StringValue value = 1;
}
// Advertiser-specific hotel ID.
message HotelIdInfo {
// String value of the hotel ID.
google.protobuf.StringValue value = 1;
}
// Class of the hotel as a number of stars 1 to 5.
message HotelClassInfo {
// Long value of the hotel class.
google.protobuf.Int64Value value = 1;
}
// Country or Region the hotel is located in.
message HotelCountryRegionInfo {
// The Geo Target Constant resource name.
google.protobuf.StringValue country_region_criterion = 1;
}
// State the hotel is located in.
message HotelStateInfo {
// The Geo Target Constant resource name.
google.protobuf.StringValue state_criterion = 1;
}
// City the hotel is located in.
message HotelCityInfo {
// The Geo Target Constant resource name.
google.protobuf.StringValue city_criterion = 1;
}
// Listing custom attribute.
message ListingCustomAttributeInfo {
// String value of the listing custom attribute.
google.protobuf.StringValue value = 1;
// Indicates the index of the custom attribute.
google.ads.googleads.v1.enums.ListingCustomAttributeIndexEnum.ListingCustomAttributeIndex index = 2;
}
// Bidding category of a product offer.
message ProductBiddingCategoryInfo {
// ID of the product bidding category.
//
// This ID is equivalent to the google_product_category ID as described in
// this article: https://support.google.com/merchants/answer/6324436.
google.protobuf.Int64Value id = 1;
// Two-letter upper-case country code of the product bidding category. It must
// match the campaign.shopping_setting.sales_country field.
google.protobuf.StringValue country_code = 2;
// Level of the product bidding category.
google.ads.googleads.v1.enums.ProductBiddingCategoryLevelEnum.ProductBiddingCategoryLevel level = 3;
}
// Locality of a product offer.
message ProductChannelInfo {
// Value of the locality.
google.ads.googleads.v1.enums.ProductChannelEnum.ProductChannel channel = 1;
}
// Availability of a product offer.
message ProductChannelExclusivityInfo {
// Value of the availability.
google.ads.googleads.v1.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity channel_exclusivity = 1;
}
// Condition of a product offer.
message ProductConditionInfo {
// Value of the condition.
google.ads.googleads.v1.enums.ProductConditionEnum.ProductCondition condition = 1;
}
// Item id of a product offer.
message ProductItemIdInfo {
// Value of the id.
google.protobuf.StringValue value = 1;
}
// Type of a product offer.
message ProductTypeInfo {
// Value of the type.
google.protobuf.StringValue value = 1;
// Level of the type.
google.ads.googleads.v1.enums.ProductTypeLevelEnum.ProductTypeLevel level = 2;
}
// Unknown listing dimension.
message UnknownListingDimensionInfo {
}
// Criterion for hotel date selection (default dates vs. user selected).
message HotelDateSelectionTypeInfo {
// Type of the hotel date selection
google.ads.googleads.v1.enums.HotelDateSelectionTypeEnum.HotelDateSelectionType type = 1;
}
// Criterion for number of days prior to the stay the booking is being made.
message HotelAdvanceBookingWindowInfo {
// Low end of the number of days prior to the stay.
google.protobuf.Int64Value min_days = 1;
// High end of the number of days prior to the stay.
google.protobuf.Int64Value max_days = 2;
}
// Criterion for length of hotel stay in nights.
message HotelLengthOfStayInfo {
// Low end of the number of nights in the stay.
google.protobuf.Int64Value min_nights = 1;
// High end of the number of nights in the stay.
google.protobuf.Int64Value max_nights = 2;
}
// Criterion for day of the week the booking is for.
message HotelCheckInDayInfo {
// The day of the week.
google.ads.googleads.v1.enums.DayOfWeekEnum.DayOfWeek day_of_week = 1;
}
// Criterion for Interaction Type.
message InteractionTypeInfo {
// The interaction type.
google.ads.googleads.v1.enums.InteractionTypeEnum.InteractionType type = 1;
}
// Represents an AdSchedule criterion.
//
// AdSchedule is specified as the day of the week and a time interval
// within which ads will be shown.
//
// No more than six AdSchedules can be added for the same day.
message AdScheduleInfo {
// Minutes after the start hour at which this schedule starts.
//
// This field is required for CREATE operations and is prohibited on UPDATE
// operations.
google.ads.googleads.v1.enums.MinuteOfHourEnum.MinuteOfHour start_minute = 1;
// Minutes after the end hour at which this schedule ends. The schedule is
// exclusive of the end minute.
//
// This field is required for CREATE operations and is prohibited on UPDATE
// operations.
google.ads.googleads.v1.enums.MinuteOfHourEnum.MinuteOfHour end_minute = 2;
// Starting hour in 24 hour time.
// This field must be between 0 and 23, inclusive.
//
// This field is required for CREATE operations and is prohibited on UPDATE
// operations.
google.protobuf.Int32Value start_hour = 3;
// Ending hour in 24 hour time; 24 signifies end of the day.
// This field must be between 0 and 24, inclusive.
//
// This field is required for CREATE operations and is prohibited on UPDATE
// operations.
google.protobuf.Int32Value end_hour = 4;
// Day of the week the schedule applies to.
//
// This field is required for CREATE operations and is prohibited on UPDATE
// operations.
google.ads.googleads.v1.enums.DayOfWeekEnum.DayOfWeek day_of_week = 5;
}
// An age range criterion.
message AgeRangeInfo {
// Type of the age range.
google.ads.googleads.v1.enums.AgeRangeTypeEnum.AgeRangeType type = 1;
}
// A gender criterion.
message GenderInfo {
// Type of the gender.
google.ads.googleads.v1.enums.GenderTypeEnum.GenderType type = 1;
}
// An income range criterion.
message IncomeRangeInfo {
// Type of the income range.
google.ads.googleads.v1.enums.IncomeRangeTypeEnum.IncomeRangeType type = 1;
}
// A parental status criterion.
message ParentalStatusInfo {
// Type of the parental status.
google.ads.googleads.v1.enums.ParentalStatusTypeEnum.ParentalStatusType type = 1;
}
// A YouTube Video criterion.
message YouTubeVideoInfo {
// YouTube video id as it appears on the YouTube watch page.
google.protobuf.StringValue video_id = 1;
}
// A YouTube Channel criterion.
message YouTubeChannelInfo {
// The YouTube uploader channel id or the channel code of a YouTube channel.
google.protobuf.StringValue channel_id = 1;
}
// A User List criterion. Represents a user list that is defined by the
// advertiser to be targeted.
message UserListInfo {
// The User List resource name.
google.protobuf.StringValue user_list = 1;
}
// A Proximity criterion. The geo point and radius determine what geographical
// area is included. The address is a description of the geo point that does
// not affect ad serving.
//
// There are two ways to create a proximity. First, by setting an address
// and radius. The geo point will be automatically computed. Second, by
// setting a geo point and radius. The address is an optional label that won't
// be validated.
message ProximityInfo {
// Latitude and longitude.
GeoPointInfo geo_point = 1;
// The radius of the proximity.
google.protobuf.DoubleValue radius = 2;
// The unit of measurement of the radius. Default is KILOMETERS.
google.ads.googleads.v1.enums.ProximityRadiusUnitsEnum.ProximityRadiusUnits radius_units = 3;
// Full address.
AddressInfo address = 4;
}
// Geo point for proximity criterion.
message GeoPointInfo {
// Micro degrees for the longitude.
google.protobuf.Int32Value longitude_in_micro_degrees = 1;
// Micro degrees for the latitude.
google.protobuf.Int32Value latitude_in_micro_degrees = 2;
}
// Address for proximity criterion.
message AddressInfo {
// Postal code.
google.protobuf.StringValue postal_code = 1;
// Province or state code.
google.protobuf.StringValue province_code = 2;
// Country code.
google.protobuf.StringValue country_code = 3;
// Province or state name.
google.protobuf.StringValue province_name = 4;
// Street address line 1.
google.protobuf.StringValue street_address = 5;
// Street address line 2. This field is write-only. It is only used for
// calculating the longitude and latitude of an address when geo_point is
// empty.
google.protobuf.StringValue street_address2 = 6;
// Name of the city.
google.protobuf.StringValue city_name = 7;
}
// A topic criterion. Use topics to target or exclude placements in the
// Google Display Network based on the category into which the placement falls
// (for example, "Pets & Animals/Pets/Dogs").
message TopicInfo {
// The Topic Constant resource name.
google.protobuf.StringValue topic_constant = 1;
// The category to target or exclude. Each subsequent element in the array
// describes a more specific sub-category. For example,
// "Pets & Animals", "Pets", "Dogs" represents the "Pets & Animals/Pets/Dogs"
// category.
repeated google.protobuf.StringValue path = 2;
}
// A language criterion.
message LanguageInfo {
// The language constant resource name.
google.protobuf.StringValue language_constant = 1;
}
// An IpBlock criterion used for IP exclusions. We allow:
// - IPv4 and IPv6 addresses
// - individual addresses (192.168.0.1)
// - masks for individual addresses (192.168.0.1/32)
// - masks for Class C networks (192.168.0.1/24)
message IpBlockInfo {
// The IP address of this IP block.
google.protobuf.StringValue ip_address = 1;
}
// Content Label for category exclusion.
message ContentLabelInfo {
// Content label type, required for CREATE operations.
google.ads.googleads.v1.enums.ContentLabelTypeEnum.ContentLabelType type = 1;
}
// Represents a Carrier Criterion.
message CarrierInfo {
// The Carrier constant resource name.
google.protobuf.StringValue carrier_constant = 1;
}
// Represents a particular interest-based topic to be targeted.
message UserInterestInfo {
// The UserInterest resource name.
google.protobuf.StringValue user_interest_category = 1;
}
// Represents a criterion for targeting webpages of an advertiser's website.
message WebpageInfo {
// The name of the criterion that is defined by this parameter. The name value
// will be used for identifying, sorting and filtering criteria with this type
// of parameters.
//
// This field is required for CREATE operations and is prohibited on UPDATE
// operations.
google.protobuf.StringValue criterion_name = 1;
// Conditions, or logical expressions, for webpage targeting. The list of
// webpage targeting conditions are and-ed together when evaluated
// for targeting.
//
// This field is required for CREATE operations and is prohibited on UPDATE
// operations.
repeated WebpageConditionInfo conditions = 2;
}
// Logical expression for targeting webpages of an advertiser's website.
message WebpageConditionInfo {
// Operand of webpage targeting condition.
google.ads.googleads.v1.enums.WebpageConditionOperandEnum.WebpageConditionOperand operand = 1;
// Operator of webpage targeting condition.
google.ads.googleads.v1.enums.WebpageConditionOperatorEnum.WebpageConditionOperator operator = 2;
// Argument of webpage targeting condition.
google.protobuf.StringValue argument = 3;
}
// Represents an operating system version to be targeted.
message OperatingSystemVersionInfo {
// The operating system version constant resource name.
google.protobuf.StringValue operating_system_version_constant = 1;
}
// An app payment model criterion.
message AppPaymentModelInfo {
// Type of the app payment model.
google.ads.googleads.v1.enums.AppPaymentModelTypeEnum.AppPaymentModelType type = 1;
}
// A mobile device criterion.
message MobileDeviceInfo {
// The mobile device constant resource name.
google.protobuf.StringValue mobile_device_constant = 1;
}
// A custom affinity criterion.
// A criterion of this type is only targetable.
message CustomAffinityInfo {
// The CustomInterest resource name.
google.protobuf.StringValue custom_affinity = 1;
}
// A custom intent criterion.
// A criterion of this type is only targetable.
message CustomIntentInfo {
// The CustomInterest resource name.
google.protobuf.StringValue custom_intent = 1;
}
// A radius around a list of locations specified via a feed.
message LocationGroupInfo {
// Feed specifying locations for targeting.
// This is required and must be set in CREATE operations.
google.protobuf.StringValue feed = 1;
// Geo target constant(s) restricting the scope of the geographic area within
// the feed. Currently only one geo target constant is allowed.
repeated google.protobuf.StringValue geo_target_constants = 2;
// Distance in units specifying the radius around targeted locations.
// This is required and must be set in CREATE operations.
google.protobuf.Int64Value radius = 3;
// Unit of the radius, miles and meters supported currently.
// This is required and must be set in CREATE operations.
google.ads.googleads.v1.enums.LocationGroupRadiusUnitsEnum.LocationGroupRadiusUnits radius_units = 4;
}

@ -1,84 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/advertising_channel_sub_type.proto";
import "google/ads/googleads/v1/enums/advertising_channel_type.proto";
import "google/ads/googleads/v1/enums/criterion_category_channel_availability_mode.proto";
import "google/ads/googleads/v1/enums/criterion_category_locale_availability_mode.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "CriterionCategoryAvailabilityProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing criterion category availability information.
// Information of category availability, per advertising channel.
message CriterionCategoryAvailability {
// Channel types and subtypes that are available to the category.
CriterionCategoryChannelAvailability channel = 1;
// Locales that are available to the category for the channel.
repeated CriterionCategoryLocaleAvailability locale = 2;
}
// Information of advertising channel type and subtypes a category is available
// in.
message CriterionCategoryChannelAvailability {
// Format of the channel availability. Can be ALL_CHANNELS (the rest of the
// fields will not be set), CHANNEL_TYPE (only advertising_channel_type type
// will be set, the category is available to all sub types under it) or
// CHANNEL_TYPE_AND_SUBTYPES (advertising_channel_type,
// advertising_channel_sub_type, and include_default_channel_sub_type will all
// be set).
google.ads.googleads.v1.enums.CriterionCategoryChannelAvailabilityModeEnum.CriterionCategoryChannelAvailabilityMode availability_mode = 1;
// Channel type the category is available to.
google.ads.googleads.v1.enums.AdvertisingChannelTypeEnum.AdvertisingChannelType advertising_channel_type = 2;
// Channel subtypes under the channel type the category is available to.
repeated google.ads.googleads.v1.enums.AdvertisingChannelSubTypeEnum.AdvertisingChannelSubType advertising_channel_sub_type = 3;
// Whether default channel sub type is included. For example,
// advertising_channel_type being DISPLAY and include_default_channel_sub_type
// being false means that the default display campaign where channel sub type
// is not set is not included in this availability configuration.
google.protobuf.BoolValue include_default_channel_sub_type = 4;
}
// Information about which locales a category is available in.
message CriterionCategoryLocaleAvailability {
// Format of the locale availability. Can be LAUNCHED_TO_ALL (both country and
// language will be empty), COUNTRY (only country will be set), LANGUAGE (only
// language wil be set), COUNTRY_AND_LANGUAGE (both country and language will
// be set).
google.ads.googleads.v1.enums.CriterionCategoryLocaleAvailabilityModeEnum.CriterionCategoryLocaleAvailabilityMode availability_mode = 1;
// Code of the country.
google.protobuf.StringValue country_code = 2;
// Code of the language.
google.protobuf.StringValue language_code = 3;
}

@ -1,42 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "CustomParameterProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing CustomParameter and operation
// A mapping that can be used by custom parameter tags in a
// `tracking_url_template`, `final_urls`, or `mobile_final_urls`.
message CustomParameter {
// The key matching the parameter tag name.
google.protobuf.StringValue key = 1;
// The value to be substituted.
google.protobuf.StringValue value = 2;
}

@ -1,41 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "DatesProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing date range message.
// A date range.
message DateRange {
// The start date, in yyyy-mm-dd format.
google.protobuf.StringValue start_date = 1;
// The end date, in yyyy-mm-dd format.
google.protobuf.StringValue end_date = 2;
}

@ -1,40 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "ExplorerAutoOptimizerSettingProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing ExplorerAutoOptimizerSetting
// Settings for the
// <a href="https://support.google.com/google-ads/answer/190596">
// Display Campaign Optimizer</a>, initially termed "Explorer".
message ExplorerAutoOptimizerSetting {
// Indicates whether the optimizer is turned on.
google.protobuf.BoolValue opt_in = 1;
}

@ -1,344 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/common/custom_parameter.proto";
import "google/ads/googleads/v1/common/feed_common.proto";
import "google/ads/googleads/v1/enums/app_store.proto";
import "google/ads/googleads/v1/enums/call_conversion_reporting_state.proto";
import "google/ads/googleads/v1/enums/price_extension_price_qualifier.proto";
import "google/ads/googleads/v1/enums/price_extension_price_unit.proto";
import "google/ads/googleads/v1/enums/price_extension_type.proto";
import "google/ads/googleads/v1/enums/promotion_extension_discount_modifier.proto";
import "google/ads/googleads/v1/enums/promotion_extension_occasion.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "ExtensionsProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing extension types.
// Represents an App extension.
message AppFeedItem {
// The visible text displayed when the link is rendered in an ad.
// The length of this string should be between 1 and 25, inclusive.
google.protobuf.StringValue link_text = 1;
// The store-specific ID for the target application.
// This string must not be empty.
google.protobuf.StringValue app_id = 2;
// The application store that the target application belongs to.
google.ads.googleads.v1.enums.AppStoreEnum.AppStore app_store = 3;
// A list of possible final URLs after all cross domain redirects.
repeated google.protobuf.StringValue final_urls = 4;
// A list of possible final mobile URLs after all cross domain redirects.
repeated google.protobuf.StringValue final_mobile_urls = 5;
// URL template for constructing a tracking URL. Default value is "{lpurl}".
google.protobuf.StringValue tracking_url_template = 6;
// A list of mappings to be used for substituting URL custom parameter tags in
// the tracking_url_template, final_urls, and/or final_mobile_urls.
repeated CustomParameter url_custom_parameters = 7;
// URL template for appending params to landing page URLs served with parallel
// tracking.
google.protobuf.StringValue final_url_suffix = 8;
}
// Represents a Call extension.
message CallFeedItem {
// The advertiser's phone number to append to the ad.
// This string must not be empty.
google.protobuf.StringValue phone_number = 1;
// Uppercase two-letter country code of the advertiser's phone number.
// This string must not be empty.
google.protobuf.StringValue country_code = 2;
// Indicates whether call tracking is enabled. By default, call tracking is
// not enabled.
google.protobuf.BoolValue call_tracking_enabled = 3;
// The conversion action to attribute a call conversion to. If not set a
// default conversion action is used. This field only has effect if
// call_tracking_enabled is set to true. Otherwise this field is ignored.
google.protobuf.StringValue call_conversion_action = 4;
// If true, disable call conversion tracking. call_conversion_action should
// not be set if this is true. Optional.
google.protobuf.BoolValue call_conversion_tracking_disabled = 5;
// Enum value that indicates whether this call extension uses its own call
// conversion setting (or just have call conversion disabled), or following
// the account level setting.
google.ads.googleads.v1.enums.CallConversionReportingStateEnum.CallConversionReportingState call_conversion_reporting_state = 6;
}
// Represents a callout extension.
message CalloutFeedItem {
// The callout text.
// The length of this string should be between 1 and 25, inclusive.
google.protobuf.StringValue callout_text = 1;
}
// Represents a location extension.
message LocationFeedItem {
// The name of the business.
google.protobuf.StringValue business_name = 1;
// Line 1 of the business address.
google.protobuf.StringValue address_line_1 = 2;
// Line 2 of the business address.
google.protobuf.StringValue address_line_2 = 3;
// City of the business address.
google.protobuf.StringValue city = 4;
// Province of the business address.
google.protobuf.StringValue province = 5;
// Postal code of the business address.
google.protobuf.StringValue postal_code = 6;
// Country code of the business address.
google.protobuf.StringValue country_code = 7;
// Phone number of the business.
google.protobuf.StringValue phone_number = 8;
}
// Represents an affiliate location extension.
message AffiliateLocationFeedItem {
// The name of the business.
google.protobuf.StringValue business_name = 1;
// Line 1 of the business address.
google.protobuf.StringValue address_line_1 = 2;
// Line 2 of the business address.
google.protobuf.StringValue address_line_2 = 3;
// City of the business address.
google.protobuf.StringValue city = 4;
// Province of the business address.
google.protobuf.StringValue province = 5;
// Postal code of the business address.
google.protobuf.StringValue postal_code = 6;
// Country code of the business address.
google.protobuf.StringValue country_code = 7;
// Phone number of the business.
google.protobuf.StringValue phone_number = 8;
// Id of the retail chain that is advertised as a seller of your product.
google.protobuf.Int64Value chain_id = 9;
// Name of chain.
google.protobuf.StringValue chain_name = 10;
}
// An extension that users can click on to send a text message to the
// advertiser.
message TextMessageFeedItem {
// The business name to prepend to the message text.
// This field is required.
google.protobuf.StringValue business_name = 1;
// Uppercase two-letter country code of the advertiser's phone number.
// This field is required.
google.protobuf.StringValue country_code = 2;
// The advertiser's phone number the message will be sent to. Required.
google.protobuf.StringValue phone_number = 3;
// The text to show in the ad.
// This field is required.
google.protobuf.StringValue text = 4;
// The message text populated in the messaging app.
google.protobuf.StringValue extension_text = 5;
}
// Represents a Price extension.
message PriceFeedItem {
// Price extension type of this extension.
google.ads.googleads.v1.enums.PriceExtensionTypeEnum.PriceExtensionType type = 1;
// Price qualifier for all offers of this price extension.
google.ads.googleads.v1.enums.PriceExtensionPriceQualifierEnum.PriceExtensionPriceQualifier price_qualifier = 2;
// Tracking URL template for all offers of this price extension.
google.protobuf.StringValue tracking_url_template = 3;
// The code of the language used for this price extension.
google.protobuf.StringValue language_code = 4;
// The price offerings in this price extension.
repeated PriceOffer price_offerings = 5;
// URL template for appending params to landing page URLs served with parallel
// tracking.
google.protobuf.StringValue final_url_suffix = 6;
}
// Represents one price offer in a price extension.
message PriceOffer {
// Header text of this offer.
google.protobuf.StringValue header = 1;
// Description text of this offer.
google.protobuf.StringValue description = 2;
// Price value of this offer.
Money price = 3;
// Price unit for this offer.
google.ads.googleads.v1.enums.PriceExtensionPriceUnitEnum.PriceExtensionPriceUnit unit = 4;
// A list of possible final URLs after all cross domain redirects.
repeated google.protobuf.StringValue final_urls = 5;
// A list of possible final mobile URLs after all cross domain redirects.
repeated google.protobuf.StringValue final_mobile_urls = 6;
}
// Represents a Promotion extension.
message PromotionFeedItem {
// A freeform description of what the promotion is targeting.
// This field is required.
google.protobuf.StringValue promotion_target = 1;
// Enum that modifies the qualification of the discount.
google.ads.googleads.v1.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;
// Start date of when the promotion is eligible to be redeemed.
google.protobuf.StringValue promotion_start_date = 7;
// End date of when the promotion is eligible to be redeemed.
google.protobuf.StringValue promotion_end_date = 8;
// The occasion the promotion was intended for.
// If an occasion is set, the redemption window will need to fall within
// the date range associated with the occasion.
google.ads.googleads.v1.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;
// A list of possible final URLs after all cross domain redirects.
// This field is required.
repeated google.protobuf.StringValue final_urls = 10;
// A list of possible final mobile URLs after all cross domain redirects.
repeated google.protobuf.StringValue final_mobile_urls = 11;
// URL template for constructing a tracking URL.
google.protobuf.StringValue tracking_url_template = 12;
// A list of mappings to be used for substituting URL custom parameter tags in
// the tracking_url_template, final_urls, and/or final_mobile_urls.
repeated CustomParameter url_custom_parameters = 13;
// URL template for appending params to landing page URLs served with parallel
// tracking.
google.protobuf.StringValue final_url_suffix = 14;
// The language of the promotion.
// Represented as BCP 47 language tag.
google.protobuf.StringValue language_code = 15;
// Discount type, can be percentage off or amount off.
oneof discount_type {
// Percentage off discount in the promotion in micros.
// One million is equivalent to one percent.
// Either this or money_off_amount is required.
google.protobuf.Int64Value percent_off = 3;
// Money amount off for discount in the promotion.
// Either this or percent_off is required.
Money money_amount_off = 4;
}
// Promotion trigger. Can be by promotion code or promo by eligible order
// amount.
oneof promotion_trigger {
// A code the user should use in order to be eligible for the promotion.
google.protobuf.StringValue promotion_code = 5;
// The amount the total order needs to be for the user to be eligible for
// the promotion.
Money orders_over_amount = 6;
}
}
// Represents a structured snippet extension.
message StructuredSnippetFeedItem {
// The header of the snippet.
// This string must not be empty.
google.protobuf.StringValue header = 1;
// The values in the snippet.
// The maximum size of this collection is 10.
repeated google.protobuf.StringValue values = 2;
}
// Represents a sitelink extension.
message SitelinkFeedItem {
// URL display text for the sitelink.
// The length of this string should be between 1 and 25, inclusive.
google.protobuf.StringValue link_text = 1;
// First line of the description for the sitelink.
// If this value is set, line2 must also be set.
// The length of this string should be between 0 and 35, inclusive.
google.protobuf.StringValue line1 = 2;
// Second line of the description for the sitelink.
// If this value is set, line1 must also be set.
// The length of this string should be between 0 and 35, inclusive.
google.protobuf.StringValue line2 = 3;
// A list of possible final URLs after all cross domain redirects.
repeated google.protobuf.StringValue final_urls = 4;
// A list of possible final mobile URLs after all cross domain redirects.
repeated google.protobuf.StringValue final_mobile_urls = 5;
// URL template for constructing a tracking URL.
google.protobuf.StringValue tracking_url_template = 6;
// A list of mappings to be used for substituting URL custom parameter tags in
// the tracking_url_template, final_urls, and/or final_mobile_urls.
repeated CustomParameter url_custom_parameters = 7;
// Final URL suffix to be appended to landing page URLs served with
// parallel tracking.
google.protobuf.StringValue final_url_suffix = 8;
}

@ -1,41 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "FeedCommonProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing common feed proto messages.
// Represents a price in a particular currency.
message Money {
// Three-character ISO 4217 currency code.
google.protobuf.StringValue currency_code = 1;
// Amount in micros. One million is equivalent to one unit.
google.protobuf.Int64Value amount_micros = 2;
}

@ -1,48 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/app_url_operating_system_type.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "FinalAppUrlProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file FinalAppUrl type.
// A URL for deep linking into an app for the given operating system.
message FinalAppUrl {
// The operating system targeted by this URL. Required.
google.ads.googleads.v1.enums.AppUrlOperatingSystemTypeEnum.AppUrlOperatingSystemType os_type = 1;
// The app deep link URL. Deep links specify a location in an app that
// corresponds to the content you'd like to show, and should be of the form
// {scheme}://{host_path}
// The scheme identifies which app to open. For your app, you can use a custom
// scheme that starts with the app's name. The host and path specify the
// unique location in the app where your content exists.
// Example: "exampleapp://productid_1234". Required.
google.protobuf.StringValue url = 2;
}

@ -1,63 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/frequency_cap_event_type.proto";
import "google/ads/googleads/v1/enums/frequency_cap_level.proto";
import "google/ads/googleads/v1/enums/frequency_cap_time_unit.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "FrequencyCapProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing frequency caps.
// A rule specifying the maximum number of times an ad (or some set of ads) can
// be shown to a user over a particular time period.
message FrequencyCapEntry {
// The key of a particular frequency cap. There can be no more
// than one frequency cap with the same key.
FrequencyCapKey key = 1;
// Maximum number of events allowed during the time range by this cap.
google.protobuf.Int32Value cap = 2;
}
// A group of fields used as keys for a frequency cap.
// There can be no more than one frequency cap with the same key.
message FrequencyCapKey {
// The level on which the cap is to be applied (e.g. ad group ad, ad group).
// The cap is applied to all the entities of this level.
google.ads.googleads.v1.enums.FrequencyCapLevelEnum.FrequencyCapLevel level = 1;
// The type of event that the cap applies to (e.g. impression).
google.ads.googleads.v1.enums.FrequencyCapEventTypeEnum.FrequencyCapEventType event_type = 3;
// Unit of time the cap is defined at (e.g. day, week).
google.ads.googleads.v1.enums.FrequencyCapTimeUnitEnum.FrequencyCapTimeUnit time_unit = 2;
// Number of time units the cap lasts.
google.protobuf.Int32Value time_length = 4;
}

@ -1,42 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/keyword_plan_competition_level.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "KeywordPlanCommonProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing Keyword Planner messages.
// Historical metrics.
message KeywordPlanHistoricalMetrics {
// Average monthly searches for the past 12 months.
google.protobuf.Int64Value avg_monthly_searches = 1;
// The competition level for the query.
google.ads.googleads.v1.enums.KeywordPlanCompetitionLevelEnum.KeywordPlanCompetitionLevel competition = 2;
}

@ -1,128 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/matching_function_context_type.proto";
import "google/ads/googleads/v1/enums/matching_function_operator.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "MatchingFunctionProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing a matching function.
// Matching function associated with a
// CustomerFeed, CampaignFeed, or AdGroupFeed. The matching function is used
// to filter the set of feed items selected.
message MatchingFunction {
// String representation of the Function.
//
// Examples:
// 1) IDENTITY(true) or IDENTITY(false). All or none feed items serve.
// 2) EQUALS(CONTEXT.DEVICE,"Mobile")
// 3) IN(FEED_ITEM_ID,{1000001,1000002,1000003})
// 4) CONTAINS_ANY(FeedAttribute[12345678,0],{"Mars cruise","Venus cruise"})
// 5) AND(IN(FEED_ITEM_ID,{10001,10002}),EQUALS(CONTEXT.DEVICE,"Mobile"))
// See
//
// https:
// //developers.google.com/adwords/api/docs/guides/feed-matching-functions
//
// Note that because multiple strings may represent the same underlying
// function (whitespace and single versus double quotation marks, for
// example), the value returned may not be identical to the string sent in a
// mutate request.
google.protobuf.StringValue function_string = 1;
// Operator for a function.
google.ads.googleads.v1.enums.MatchingFunctionOperatorEnum.MatchingFunctionOperator operator = 4;
// The operands on the left hand side of the equation. This is also the
// operand to be used for single operand expressions such as NOT.
repeated Operand left_operands = 2;
// The operands on the right hand side of the equation.
repeated Operand right_operands = 3;
}
// An operand in a matching function.
message Operand {
// A constant operand in a matching function.
message ConstantOperand {
// Constant operand values. Required.
oneof constant_operand_value {
// String value of the operand if it is a string type.
google.protobuf.StringValue string_value = 1;
// Int64 value of the operand if it is a int64 type.
google.protobuf.Int64Value long_value = 2;
// Boolean value of the operand if it is a boolean type.
google.protobuf.BoolValue boolean_value = 3;
// Double value of the operand if it is a double type.
google.protobuf.DoubleValue double_value = 4;
}
}
// A feed attribute operand in a matching function.
// Used to represent a feed attribute in feed.
message FeedAttributeOperand {
// The associated feed. Required.
google.protobuf.Int64Value feed_id = 1;
// Id of the referenced feed attribute. Required.
google.protobuf.Int64Value feed_attribute_id = 2;
}
// A function operand in a matching function.
// Used to represent nested functions.
message FunctionOperand {
// The matching function held in this operand.
MatchingFunction matching_function = 1;
}
// An operand in a function referring to a value in the request context.
message RequestContextOperand {
// Type of value to be referred in the request context.
google.ads.googleads.v1.enums.MatchingFunctionContextTypeEnum.MatchingFunctionContextType context_type = 1;
}
// Different operands that can be used in a matching function. Required.
oneof function_argument_operand {
// A constant operand in a matching function.
ConstantOperand constant_operand = 1;
// This operand specifies a feed attribute in feed.
FeedAttributeOperand feed_attribute_operand = 2;
// A function operand in a matching function.
// Used to represent nested functions.
FunctionOperand function_operand = 3;
// An operand in a function referring to a value in the request context.
RequestContextOperand request_context_operand = 4;
}
}

@ -1,527 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/interaction_event_type.proto";
import "google/ads/googleads/v1/enums/quality_score_bucket.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "MetricsProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing metrics.
// Metrics data.
message Metrics {
// The percent of your ad impressions that are shown as the very first ad
// above the organic search results.
google.protobuf.DoubleValue absolute_top_impression_percentage = 95;
// Average cost of viewable impressions (`active_view_impressions`).
google.protobuf.DoubleValue active_view_cpm = 1;
// Active view measurable clicks divided by active view viewable impressions.
// This metric is reported only for display network.
google.protobuf.DoubleValue active_view_ctr = 79;
// A measurement of how often your ad has become viewable on a Display
// Network site.
google.protobuf.Int64Value active_view_impressions = 2;
// The ratio of impressions that could be measured by Active View over the
// number of served impressions.
google.protobuf.DoubleValue active_view_measurability = 96;
// The cost of the impressions you received that were measurable by Active
// View.
google.protobuf.Int64Value active_view_measurable_cost_micros = 3;
// The number of times your ads are appearing on placements in positions
// where they can be seen.
google.protobuf.Int64Value active_view_measurable_impressions = 4;
// The percentage of time when your ad appeared on an Active View enabled site
// (measurable impressions) and was viewable (viewable impressions).
google.protobuf.DoubleValue active_view_viewability = 97;
// All conversions from interactions (as oppose to view through conversions)
// divided by the number of ad interactions.
google.protobuf.DoubleValue all_conversions_from_interactions_rate = 65;
// The total value of all conversions.
google.protobuf.DoubleValue all_conversions_value = 66;
// The total number of conversions. This only includes conversion actions
// which include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue all_conversions = 7;
// The value of all conversions divided by the total cost of ad interactions
// (such as clicks for text ads or views for video ads).
google.protobuf.DoubleValue all_conversions_value_per_cost = 62;
// The number of times people clicked the "Call" button to call a store during
// or after clicking an ad. This number doesnt include whether or not calls
// were connected, or the duration of any calls.
// This metric applies to feed items only.
google.protobuf.DoubleValue all_conversions_from_click_to_call = 118;
// The number of times people clicked a "Get directions" button to navigate to
// a store after clicking an ad.
// This metric applies to feed items only.
google.protobuf.DoubleValue all_conversions_from_directions = 119;
// The value of all conversions from interactions divided by the total number
// of interactions.
google.protobuf.DoubleValue all_conversions_from_interactions_value_per_interaction = 67;
// The number of times people clicked a link to view a stores menu after
// clicking an ad.
// This metric applies to feed items only.
google.protobuf.DoubleValue all_conversions_from_menu = 120;
// The number of times people placed an order at a store after clicking an ad.
// This metric applies to feed items only.
google.protobuf.DoubleValue all_conversions_from_order = 121;
// The number of other conversions (for example, posting a review or saving a
// location for a store) that occurred after people clicked an ad.
// This metric applies to feed items only.
google.protobuf.DoubleValue all_conversions_from_other_engagement = 122;
// Estimated number of times people visited a store after clicking an ad.
// This metric applies to feed items only.
google.protobuf.DoubleValue all_conversions_from_store_visit = 123;
// The number of times that people were taken to a store's URL after clicking
// an ad.
// This metric applies to feed items only.
google.protobuf.DoubleValue all_conversions_from_store_website = 124;
// The average amount you pay per interaction. This amount is the total cost
// of your ads divided by the total number of interactions.
google.protobuf.DoubleValue average_cost = 8;
// The total cost of all clicks divided by the total number of clicks
// received.
google.protobuf.DoubleValue average_cpc = 9;
// The average amount that you've been charged for an ad engagement. This
// amount is the total cost of all ad engagements divided by the total number
// of ad engagements.
google.protobuf.DoubleValue average_cpe = 98;
// Average cost-per-thousand impressions (CPM).
google.protobuf.DoubleValue average_cpm = 10;
// The average amount you pay each time someone views your ad.
// The average CPV is defined by the total cost of all ad views divided by
// the number of views.
google.protobuf.DoubleValue average_cpv = 11;
// Average number of times a unique cookie was exposed to your ad
// over a given time period. Imported from Google Analytics.
google.protobuf.DoubleValue average_frequency = 12;
// Average number of pages viewed per session.
google.protobuf.DoubleValue average_page_views = 99;
// Your ad's position relative to those of other advertisers.
google.protobuf.DoubleValue average_position = 13;
// Total duration of all sessions (in seconds) / number of sessions. Imported
// from Google Analytics.
google.protobuf.DoubleValue average_time_on_site = 84;
// An indication of how other advertisers are bidding on similar products.
google.protobuf.DoubleValue benchmark_average_max_cpc = 14;
// An indication on how other advertisers' Shopping ads for similar products
// are performing based on how often people who see their ad click on it.
google.protobuf.DoubleValue benchmark_ctr = 77;
// Percentage of clicks where the user only visited a single page on your
// site. Imported from Google Analytics.
google.protobuf.DoubleValue bounce_rate = 15;
// The number of clicks.
google.protobuf.Int64Value clicks = 19;
// The number of times your ad or your site's listing in the unpaid
// results was clicked. See the help page at
// https://support.google.com/google-ads/answer/3097241 for details.
google.protobuf.Int64Value combined_clicks = 115;
// The number of times your ad or your site's listing in the unpaid
// results was clicked (combined_clicks) divided by combined_queries. See the
// help page at https://support.google.com/google-ads/answer/3097241 for
// details.
google.protobuf.DoubleValue combined_clicks_per_query = 116;
// The number of searches that returned pages from your site in the unpaid
// results or showed one of your text ads. See the help page at
// https://support.google.com/google-ads/answer/3097241 for details.
google.protobuf.Int64Value combined_queries = 117;
// The estimated percent of times that your ad was eligible to show
// on the Display Network but didn't because your budget was too low.
// Note: Content budget lost impression share is reported in the range of 0
// to 0.9. Any value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue content_budget_lost_impression_share = 20;
// The impressions you've received on the Display Network divided
// by the estimated number of impressions you were eligible to receive.
// Note: Content impression share is reported in the range of 0.1 to 1. Any
// value below 0.1 is reported as 0.0999.
google.protobuf.DoubleValue content_impression_share = 21;
// The last date/time a conversion tag for this conversion action successfully
// fired and was seen by Google Ads. This firing event may not have been the
// result of an attributable conversion (e.g. because the tag was fired from a
// browser that did not previously click an ad from an appropriate
// advertiser). The date/time is in the customer's time zone.
google.protobuf.StringValue conversion_last_received_request_date_time = 73;
// The date of the most recent conversion for this conversion action. The date
// is in the customer's time zone.
google.protobuf.StringValue conversion_last_conversion_date = 74;
// The estimated percentage of impressions on the Display Network
// that your ads didn't receive due to poor Ad Rank.
// Note: Content rank lost impression share is reported in the range of 0
// to 0.9. Any value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue content_rank_lost_impression_share = 22;
// Conversions from interactions divided by the number of ad interactions
// (such as clicks for text ads or views for video ads). This only includes
// conversion actions which include_in_conversions_metric attribute is set to
// true.
google.protobuf.DoubleValue conversions_from_interactions_rate = 69;
// The total value of conversions. This only includes conversion actions which
// include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue conversions_value = 70;
// The value of conversions divided by the cost of ad interactions. This only
// includes conversion actions which include_in_conversions_metric attribute
// is set to true.
google.protobuf.DoubleValue conversions_value_per_cost = 71;
// The value of conversions from interactions divided by the number of ad
// interactions. This only includes conversion actions which
// include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue conversions_from_interactions_value_per_interaction = 72;
// The number of conversions. This only includes conversion actions which
// include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue conversions = 25;
// The sum of your cost-per-click (CPC) and cost-per-thousand impressions
// (CPM) costs during this period.
google.protobuf.Int64Value cost_micros = 26;
// The cost of ad interactions divided by all conversions.
google.protobuf.DoubleValue cost_per_all_conversions = 68;
// The cost of ad interactions divided by conversions. This only includes
// conversion actions which include_in_conversions_metric attribute is set to
// true.
google.protobuf.DoubleValue cost_per_conversion = 28;
// The cost of ad interactions divided by current model attributed
// conversions. This only includes conversion actions which
// include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue cost_per_current_model_attributed_conversion = 106;
// Conversions from when a customer clicks on a Google Ads ad on one device,
// then converts on a different device or browser.
// Cross-device conversions are already included in all_conversions.
google.protobuf.DoubleValue cross_device_conversions = 29;
// The number of clicks your ad receives (Clicks) divided by the number
// of times your ad is shown (Impressions).
google.protobuf.DoubleValue ctr = 30;
// Shows how your historic conversions data would look under the attribution
// model you've currently selected. This only includes conversion actions
// which include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue current_model_attributed_conversions = 101;
// Current model attributed conversions from interactions divided by the
// number of ad interactions (such as clicks for text ads or views for video
// ads). This only includes conversion actions which
// include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue current_model_attributed_conversions_from_interactions_rate = 102;
// The value of current model attributed conversions from interactions divided
// by the number of ad interactions. This only includes conversion actions
// which include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue current_model_attributed_conversions_from_interactions_value_per_interaction = 103;
// The total value of current model attributed conversions. This only includes
// conversion actions which include_in_conversions_metric attribute is set to
// true.
google.protobuf.DoubleValue current_model_attributed_conversions_value = 104;
// The value of current model attributed conversions divided by the cost of ad
// interactions. This only includes conversion actions which
// include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue current_model_attributed_conversions_value_per_cost = 105;
// How often people engage with your ad after it's shown to them. This is the
// number of ad expansions divided by the number of times your ad is shown.
google.protobuf.DoubleValue engagement_rate = 31;
// The number of engagements.
// An engagement occurs when a viewer expands your Lightbox ad. Also, in the
// future, other ad types may support engagement metrics.
google.protobuf.Int64Value engagements = 32;
// Average lead value of hotel.
google.protobuf.DoubleValue hotel_average_lead_value_micros = 75;
// The creative historical quality score.
google.ads.googleads.v1.enums.QualityScoreBucketEnum.QualityScoreBucket historical_creative_quality_score = 80;
// The quality of historical landing page experience.
google.ads.googleads.v1.enums.QualityScoreBucketEnum.QualityScoreBucket historical_landing_page_quality_score = 81;
// The historical quality score.
google.protobuf.Int64Value historical_quality_score = 82;
// The historical search predicted click through rate (CTR).
google.ads.googleads.v1.enums.QualityScoreBucketEnum.QualityScoreBucket historical_search_predicted_ctr = 83;
// The number of times the ad was forwarded to someone else as a message.
google.protobuf.Int64Value gmail_forwards = 85;
// The number of times someone has saved your Gmail ad to their inbox as a
// message.
google.protobuf.Int64Value gmail_saves = 86;
// The number of clicks to the landing page on the expanded state of Gmail
// ads.
google.protobuf.Int64Value gmail_secondary_clicks = 87;
// Number of unique cookies that were exposed to your ad over a given time
// period.
google.protobuf.Int64Value impression_reach = 36;
// The number of times a store's location-based ad was shown.
// This metric applies to feed items only.
google.protobuf.Int64Value impressions_from_store_reach = 125;
// Count of how often your ad has appeared on a search results page or
// website on the Google Network.
google.protobuf.Int64Value impressions = 37;
// How often people interact with your ad after it is shown to them.
// This is the number of interactions divided by the number of times your ad
// is shown.
google.protobuf.DoubleValue interaction_rate = 38;
// The number of interactions.
// An interaction is the main user action associated with an ad format-clicks
// for text and shopping ads, views for video ads, and so on.
google.protobuf.Int64Value interactions = 39;
// The types of payable and free interactions.
repeated google.ads.googleads.v1.enums.InteractionEventTypeEnum.InteractionEventType interaction_event_types = 100;
// The percentage of clicks filtered out of your total number of clicks
// (filtered + non-filtered clicks) during the reporting period.
google.protobuf.DoubleValue invalid_click_rate = 40;
// Number of clicks Google considers illegitimate and doesn't charge you for.
google.protobuf.Int64Value invalid_clicks = 41;
// The percentage of mobile clicks that go to a mobile-friendly page.
google.protobuf.DoubleValue mobile_friendly_clicks_percentage = 109;
// The number of times someone clicked your site's listing in the unpaid
// results for a particular query. See the help page at
// https://support.google.com/google-ads/answer/3097241 for details.
google.protobuf.Int64Value organic_clicks = 110;
// The number of times someone clicked your site's listing in the unpaid
// results (organic_clicks) divided by the total number of searches that
// returned pages from your site (organic_queries). See the help page at
// https://support.google.com/google-ads/answer/3097241 for details.
google.protobuf.DoubleValue organic_clicks_per_query = 111;
// The number of listings for your site in the unpaid search results. See the
// help page at https://support.google.com/google-ads/answer/3097241 for
// details.
google.protobuf.Int64Value organic_impressions = 112;
// The number of times a page from your site was listed in the unpaid search
// results (organic_impressions) divided by the number of searches returning
// your site's listing in the unpaid results (organic_queries). See the help
// page at https://support.google.com/google-ads/answer/3097241 for details.
google.protobuf.DoubleValue organic_impressions_per_query = 113;
// The total number of searches that returned your site's listing in the
// unpaid results. See the help page at
// https://support.google.com/google-ads/answer/3097241 for details.
google.protobuf.Int64Value organic_queries = 114;
// Percentage of first-time sessions (from people who had never visited your
// site before). Imported from Google Analytics.
google.protobuf.DoubleValue percent_new_visitors = 42;
// Number of offline phone calls.
google.protobuf.Int64Value phone_calls = 43;
// Number of offline phone impressions.
google.protobuf.Int64Value phone_impressions = 44;
// Number of phone calls received (phone_calls) divided by the number of
// times your phone number is shown (phone_impressions).
google.protobuf.DoubleValue phone_through_rate = 45;
// Your clickthrough rate (Ctr) divided by the average clickthrough rate of
// all advertisers on the websites that show your ads. Measures how your ads
// perform on Display Network sites compared to other ads on the same sites.
google.protobuf.DoubleValue relative_ctr = 46;
// The percentage of the customer's Shopping or Search ad impressions that are
// shown in the most prominent Shopping position. See
// <a href="https://support.google.com/adwords/answer/7501826">this Merchant
// Center article</a> for details. Any value below 0.1 is reported as 0.0999.
google.protobuf.DoubleValue search_absolute_top_impression_share = 78;
// The number estimating how often your ad wasn't the very first ad above the
// organic search results due to a low budget. Note: Search
// budget lost absolute top impression share is reported in the range of 0 to
// 0.9. Any value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue search_budget_lost_absolute_top_impression_share = 88;
// The estimated percent of times that your ad was eligible to show on the
// Search Network but didn't because your budget was too low. Note: Search
// budget lost impression share is reported in the range of 0 to 0.9. Any
// value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue search_budget_lost_impression_share = 47;
// The number estimating how often your ad didn't show anywhere above the
// organic search results due to a low budget. Note: Search
// budget lost top impression share is reported in the range of 0 to 0.9. Any
// value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue search_budget_lost_top_impression_share = 89;
// The number of clicks you've received on the Search Network
// divided by the estimated number of clicks you were eligible to receive.
// Note: Search click share is reported in the range of 0.1 to 1. Any value
// below 0.1 is reported as 0.0999.
google.protobuf.DoubleValue search_click_share = 48;
// The impressions you've received divided by the estimated number of
// impressions you were eligible to receive on the Search Network for search
// terms that matched your keywords exactly (or were close variants of your
// keyword), regardless of your keyword match types. Note: Search exact match
// impression share is reported in the range of 0.1 to 1. Any value below 0.1
// is reported as 0.0999.
google.protobuf.DoubleValue search_exact_match_impression_share = 49;
// The impressions you've received on the Search Network divided
// by the estimated number of impressions you were eligible to receive.
// Note: Search impression share is reported in the range of 0.1 to 1. Any
// value below 0.1 is reported as 0.0999.
google.protobuf.DoubleValue search_impression_share = 50;
// The number estimating how often your ad wasn't the very first ad above the
// organic search results due to poor Ad Rank.
// Note: Search rank lost absolute top impression share is reported in the
// range of 0 to 0.9. Any value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue search_rank_lost_absolute_top_impression_share = 90;
// The estimated percentage of impressions on the Search Network
// that your ads didn't receive due to poor Ad Rank.
// Note: Search rank lost impression share is reported in the range of 0 to
// 0.9. Any value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue search_rank_lost_impression_share = 51;
// The number estimating how often your ad didn't show anywhere above the
// organic search results due to poor Ad Rank.
// Note: Search rank lost top impression share is reported in the range of 0
// to 0.9. Any value above 0.9 is reported as 0.9001.
google.protobuf.DoubleValue search_rank_lost_top_impression_share = 91;
// The impressions you've received in the top location (anywhere above the
// organic search results) compared to the estimated number of impressions you
// were eligible to receive in the top location.
// Note: Search top impression share is reported in the range of 0.1 to 1. Any
// value below 0.1 is reported as 0.0999.
google.protobuf.DoubleValue search_top_impression_share = 92;
// A measure of how quickly your page loads after clicks on your mobile ads.
// The score is a range from 1 to 10, 10 being the fastest.
google.protobuf.Int64Value speed_score = 107;
// The percent of your ad impressions that are shown anywhere above the
// organic search results.
google.protobuf.DoubleValue top_impression_percentage = 93;
// The percentage of ad clicks to Accelerated Mobile Pages (AMP) landing pages
// that reach a valid AMP page.
google.protobuf.DoubleValue valid_accelerated_mobile_pages_clicks_percentage = 108;
// The value of all conversions divided by the number of all conversions.
google.protobuf.DoubleValue value_per_all_conversions = 52;
// The value of conversions divided by the number of conversions. This only
// includes conversion actions which include_in_conversions_metric attribute
// is set to true.
google.protobuf.DoubleValue value_per_conversion = 53;
// The value of current model attributed conversions divided by the number of
// the conversions. This only includes conversion actions which
// include_in_conversions_metric attribute is set to true.
google.protobuf.DoubleValue value_per_current_model_attributed_conversion = 94;
// Percentage of impressions where the viewer watched all of your video.
google.protobuf.DoubleValue video_quartile_100_rate = 54;
// Percentage of impressions where the viewer watched 25% of your video.
google.protobuf.DoubleValue video_quartile_25_rate = 55;
// Percentage of impressions where the viewer watched 50% of your video.
google.protobuf.DoubleValue video_quartile_50_rate = 56;
// Percentage of impressions where the viewer watched 75% of your video.
google.protobuf.DoubleValue video_quartile_75_rate = 57;
// The number of views your TrueView video ad receives divided by its number
// of impressions, including thumbnail impressions for TrueView in-display
// ads.
google.protobuf.DoubleValue video_view_rate = 58;
// The number of times your video ads were viewed.
google.protobuf.Int64Value video_views = 59;
// The total number of view-through conversions.
// These happen when a customer sees an image or rich media ad, then later
// completes a conversion on your site without interacting with (e.g.,
// clicking on) another ad.
google.protobuf.Int64Value view_through_conversions = 60;
}

@ -1,217 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/policy_topic_entry_type.proto";
import "google/ads/googleads/v1/enums/policy_topic_evidence_destination_mismatch_url_type.proto";
import "google/ads/googleads/v1/enums/policy_topic_evidence_destination_not_working_device.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "PolicyProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing policy information.
// Key of the violation. The key is used for referring to a violation
// when filing an exemption request.
message PolicyViolationKey {
// Unique ID of the violated policy.
google.protobuf.StringValue policy_name = 1;
// The text that violates the policy if specified.
// Otherwise, refers to the policy in general
// (e.g., when requesting to be exempt from the whole policy).
// If not specified for criterion exemptions, the whole policy is implied.
// Must be specified for ad exemptions.
google.protobuf.StringValue violating_text = 2;
}
// Parameter for controlling how policy exemption is done. Ignorable policy
// topics are only usable with expanded text ads and responsive search ads. All
// other ad types must use policy violation keys.
message PolicyValidationParameter {
// The list of policy topics that should not cause a PolicyFindingError to
// be reported. This field is currently only compatible with Enhanced Text Ad.
// It corresponds to the PolicyTopicEntry.topic field.
//
// Resources violating these policies will be saved, but will not be eligible
// to serve. They may begin serving at a later time due to a change in
// policies, re-review of the resource, or a change in advertiser
// certificates.
repeated google.protobuf.StringValue ignorable_policy_topics = 1;
// The list of policy violation keys that should not cause a
// PolicyViolationError to be reported. Not all policy violations are
// exemptable, please refer to the is_exemptible field in the returned
// PolicyViolationError.
//
// Resources violating these polices will be saved, but will not be eligible
// to serve. They may begin serving at a later time due to a change in
// policies, re-review of the resource, or a change in advertiser
// certificates.
repeated PolicyViolationKey exempt_policy_violation_keys = 2;
}
// Policy finding attached to a resource (e.g. alcohol policy associated with
// a site that sells alcohol).
//
// Each PolicyTopicEntry has a topic that indicates the specific ads policy
// the entry is about and a type to indicate the effect that the entry will have
// on serving. It may optionally have one or more evidences that indicate the
// reason for the finding. It may also optionally have one or more constraints
// that provide details about how serving may be restricted.
message PolicyTopicEntry {
// Policy topic this finding refers to. For example, "ALCOHOL",
// "TRADEMARKS_IN_AD_TEXT", or "DESTINATION_NOT_WORKING". The set of possible
// policy topics is not fixed for a particular API version and may change
// at any time.
google.protobuf.StringValue topic = 1;
// Describes the negative or positive effect this policy will have on serving.
google.ads.googleads.v1.enums.PolicyTopicEntryTypeEnum.PolicyTopicEntryType type = 2;
// Additional information that explains policy finding
// (e.g. the brand name for a trademark finding).
repeated PolicyTopicEvidence evidences = 3;
// Indicates how serving of this resource may be affected (e.g. not serving
// in a country).
repeated PolicyTopicConstraint constraints = 4;
}
// Additional information that explains a policy finding.
message PolicyTopicEvidence {
// A list of fragments of text that violated a policy.
message TextList {
// The fragments of text from the resource that caused the policy finding.
repeated google.protobuf.StringValue texts = 1;
}
// A list of websites that caused a policy finding. Used for
// ONE_WEBSITE_PER_AD_GROUP policy topic, for example. In case there are more
// than five websites, only the top five (those that appear in resources the
// most) will be listed here.
message WebsiteList {
// Websites that caused the policy finding.
repeated google.protobuf.StringValue websites = 1;
}
// A list of strings found in a destination page that caused a policy
// finding.
message DestinationTextList {
// List of text found in the resource's destination page.
repeated google.protobuf.StringValue destination_texts = 1;
}
// Evidence of mismatches between the URLs of a resource.
message DestinationMismatch {
// The set of URLs that did not match each other.
repeated google.ads.googleads.v1.enums.PolicyTopicEvidenceDestinationMismatchUrlTypeEnum.PolicyTopicEvidenceDestinationMismatchUrlType url_types = 1;
}
// Evidence details when the destination is returning an HTTP error
// code or isn't functional in all locations for commonly used devices.
message DestinationNotWorking {
// The full URL that didn't work.
google.protobuf.StringValue expanded_url = 3;
// The type of device that failed to load the URL.
google.ads.googleads.v1.enums.PolicyTopicEvidenceDestinationNotWorkingDeviceEnum.PolicyTopicEvidenceDestinationNotWorkingDevice device = 4;
// The time the URL was last checked.
// The format is "YYYY-MM-DD HH:MM:SS".
// Examples: "2018-03-05 09:15:00" or "2018-02-01 14:34:30"
google.protobuf.StringValue last_checked_date_time = 5;
}
// Specific evidence information depending on the evidence type.
oneof value {
// HTTP code returned when the final URL was crawled.
google.protobuf.Int32Value http_code = 2;
// List of websites linked with this resource.
WebsiteList website_list = 3;
// List of evidence found in the text of a resource.
TextList text_list = 4;
// The language the resource was detected to be written in.
// This is an IETF language tag such as "en-US".
google.protobuf.StringValue language_code = 5;
// The text in the destination of the resource that is causing a policy
// finding.
DestinationTextList destination_text_list = 6;
// Mismatch between the destinations of a resource's URLs.
DestinationMismatch destination_mismatch = 7;
// Details when the destination is returning an HTTP error code or isn't
// functional in all locations for commonly used devices.
DestinationNotWorking destination_not_working = 8;
}
}
// Describes the effect on serving that a policy topic entry will have.
message PolicyTopicConstraint {
// A list of countries where a resource's serving is constrained.
message CountryConstraintList {
// Total number of countries targeted by the resource.
google.protobuf.Int32Value total_targeted_countries = 1;
// Countries in which serving is restricted.
repeated CountryConstraint countries = 2;
}
// Indicates that a policy topic was constrained due to disapproval of the
// website for reseller purposes.
message ResellerConstraint {
}
// Indicates that a resource's ability to serve in a particular country is
// constrained.
message CountryConstraint {
// Geo target constant resource name of the country in which serving is
// constrained.
google.protobuf.StringValue country_criterion = 1;
}
// Specific information about the constraint.
oneof value {
// Countries where the resource cannot serve.
CountryConstraintList country_constraint_list = 1;
// Reseller constraint.
ResellerConstraint reseller_constraint = 2;
// Countries where a certificate is required for serving.
CountryConstraintList certificate_missing_in_country_list = 3;
// Countries where the resource's domain is not covered by the
// certificates associated with it.
CountryConstraintList certificate_domain_mismatch_in_country_list = 4;
}
}

@ -1,39 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "RealTimeBiddingSettingProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing RealTimeBiddingSetting
// Settings for Real-Time Bidding, a feature only available for campaigns
// targeting the Ad Exchange network.
message RealTimeBiddingSetting {
// Whether the campaign is opted in to real-time bidding.
google.protobuf.BoolValue opt_in = 1;
}

@ -1,294 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/common/criteria.proto";
import "google/ads/googleads/v1/enums/ad_network_type.proto";
import "google/ads/googleads/v1/enums/click_type.proto";
import "google/ads/googleads/v1/enums/conversion_action_category.proto";
import "google/ads/googleads/v1/enums/conversion_attribution_event_type.proto";
import "google/ads/googleads/v1/enums/conversion_lag_bucket.proto";
import "google/ads/googleads/v1/enums/conversion_or_adjustment_lag_bucket.proto";
import "google/ads/googleads/v1/enums/day_of_week.proto";
import "google/ads/googleads/v1/enums/device.proto";
import "google/ads/googleads/v1/enums/external_conversion_source.proto";
import "google/ads/googleads/v1/enums/hotel_date_selection_type.proto";
import "google/ads/googleads/v1/enums/month_of_year.proto";
import "google/ads/googleads/v1/enums/placeholder_type.proto";
import "google/ads/googleads/v1/enums/product_channel.proto";
import "google/ads/googleads/v1/enums/product_channel_exclusivity.proto";
import "google/ads/googleads/v1/enums/product_condition.proto";
import "google/ads/googleads/v1/enums/search_engine_results_page_type.proto";
import "google/ads/googleads/v1/enums/search_term_match_type.proto";
import "google/ads/googleads/v1/enums/slot.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "SegmentsProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing segment only fields.
// Segment only fields.
message Segments {
// Ad network type.
google.ads.googleads.v1.enums.AdNetworkTypeEnum.AdNetworkType ad_network_type = 3;
// Click type.
google.ads.googleads.v1.enums.ClickTypeEnum.ClickType click_type = 26;
// Resource name of the conversion action.
google.protobuf.StringValue conversion_action = 52;
// Conversion action category.
google.ads.googleads.v1.enums.ConversionActionCategoryEnum.ConversionActionCategory conversion_action_category = 53;
// Conversion action name.
google.protobuf.StringValue conversion_action_name = 54;
// This segments your conversion columns by the original conversion and
// conversion value vs. the delta if conversions were adjusted. False row has
// the data as originally stated; While true row has the delta between data
// now and the data as originally stated. Summing the two together results
// post-adjustment data.
google.protobuf.BoolValue conversion_adjustment = 27;
// Conversion attribution event type.
google.ads.googleads.v1.enums.ConversionAttributionEventTypeEnum.ConversionAttributionEventType conversion_attribution_event_type = 2;
// An enum value representing the number of days between the impression and
// the conversion.
google.ads.googleads.v1.enums.ConversionLagBucketEnum.ConversionLagBucket conversion_lag_bucket = 50;
// An enum value representing the number of days between the impression and
// the conversion or between the impression and adjustments to the conversion.
google.ads.googleads.v1.enums.ConversionOrAdjustmentLagBucketEnum.ConversionOrAdjustmentLagBucket conversion_or_adjustment_lag_bucket = 51;
// Date to which metrics apply.
// yyyy-MM-dd format, e.g., 2018-04-17.
google.protobuf.StringValue date = 4;
// Day of the week, e.g., MONDAY.
google.ads.googleads.v1.enums.DayOfWeekEnum.DayOfWeek day_of_week = 5;
// Device to which metrics apply.
google.ads.googleads.v1.enums.DeviceEnum.Device device = 1;
// External conversion source.
google.ads.googleads.v1.enums.ExternalConversionSourceEnum.ExternalConversionSource external_conversion_source = 55;
// Resource name of the geo target constant that represents an airport.
google.protobuf.StringValue geo_target_airport = 65;
// Resource name of the geo target constant that represents a city.
google.protobuf.StringValue geo_target_city = 62;
// Resource name of the geo target constant that represents a county.
google.protobuf.StringValue geo_target_county = 68;
// Resource name of the geo target constant that represents a district.
google.protobuf.StringValue geo_target_district = 69;
// Resource name of the geo target constant that represents a metro.
google.protobuf.StringValue geo_target_metro = 63;
// Resource name of the geo target constant that represents the most
// specific location.
google.protobuf.StringValue geo_target_most_specific_location = 72;
// Resource name of the geo target constant that represents a postal code.
google.protobuf.StringValue geo_target_postal_code = 71;
// Resource name of the geo target constant that represents a region.
google.protobuf.StringValue geo_target_region = 64;
// Resource name of the geo target constant that represents a state.
google.protobuf.StringValue geo_target_state = 67;
// Hotel booking window in days.
google.protobuf.Int64Value hotel_booking_window_days = 6;
// Hotel center ID.
google.protobuf.Int64Value hotel_center_id = 7;
// Hotel check-in date. Formatted as yyyy-MM-dd.
google.protobuf.StringValue hotel_check_in_date = 8;
// Hotel check-in day of week.
google.ads.googleads.v1.enums.DayOfWeekEnum.DayOfWeek hotel_check_in_day_of_week = 9;
// Hotel city.
google.protobuf.StringValue hotel_city = 10;
// Hotel class.
google.protobuf.Int32Value hotel_class = 11;
// Hotel country.
google.protobuf.StringValue hotel_country = 12;
// Hotel date selection type.
google.ads.googleads.v1.enums.HotelDateSelectionTypeEnum.HotelDateSelectionType hotel_date_selection_type = 13;
// Hotel length of stay.
google.protobuf.Int32Value hotel_length_of_stay = 14;
// Hotel state.
google.protobuf.StringValue hotel_state = 15;
// Hour of day as a number between 0 and 23, inclusive.
google.protobuf.Int32Value hour = 16;
// Only used with feed item metrics.
// Indicates whether the interaction metrics occurred on the feed item itself
// or a different extension or ad unit.
google.protobuf.BoolValue interaction_on_this_extension = 49;
// Keyword criterion.
Keyword keyword = 61;
// Month as represented by the date of the first day of a month. Formatted as
// yyyy-MM-dd.
google.protobuf.StringValue month = 17;
// Month of the year, e.g., January.
google.ads.googleads.v1.enums.MonthOfYearEnum.MonthOfYear month_of_year = 18;
// Partner hotel ID.
google.protobuf.StringValue partner_hotel_id = 19;
// Placeholder type. This is only used with feed item metrics.
google.ads.googleads.v1.enums.PlaceholderTypeEnum.PlaceholderType placeholder_type = 20;
// Aggregator ID of the product.
google.protobuf.UInt64Value product_aggregator_id = 28;
// Bidding category (level 1) of the product.
google.protobuf.StringValue product_bidding_category_level1 = 56;
// Bidding category (level 2) of the product.
google.protobuf.StringValue product_bidding_category_level2 = 57;
// Bidding category (level 3) of the product.
google.protobuf.StringValue product_bidding_category_level3 = 58;
// Bidding category (level 4) of the product.
google.protobuf.StringValue product_bidding_category_level4 = 59;
// Bidding category (level 5) of the product.
google.protobuf.StringValue product_bidding_category_level5 = 60;
// Brand of the product.
google.protobuf.StringValue product_brand = 29;
// Channel of the product.
google.ads.googleads.v1.enums.ProductChannelEnum.ProductChannel product_channel = 30;
// Channel exclusivity of the product.
google.ads.googleads.v1.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity product_channel_exclusivity = 31;
// Condition of the product.
google.ads.googleads.v1.enums.ProductConditionEnum.ProductCondition product_condition = 32;
// Resource name of the geo target constant for the country of sale of the
// product.
google.protobuf.StringValue product_country = 33;
// Custom attribute 0 of the product.
google.protobuf.StringValue product_custom_attribute0 = 34;
// Custom attribute 1 of the product.
google.protobuf.StringValue product_custom_attribute1 = 35;
// Custom attribute 2 of the product.
google.protobuf.StringValue product_custom_attribute2 = 36;
// Custom attribute 3 of the product.
google.protobuf.StringValue product_custom_attribute3 = 37;
// Custom attribute 4 of the product.
google.protobuf.StringValue product_custom_attribute4 = 38;
// Item ID of the product.
google.protobuf.StringValue product_item_id = 39;
// Resource name of the language constant for the language of the product.
google.protobuf.StringValue product_language = 40;
// Merchant ID of the product.
google.protobuf.UInt64Value product_merchant_id = 41;
// Store ID of the product.
google.protobuf.StringValue product_store_id = 42;
// Title of the product.
google.protobuf.StringValue product_title = 43;
// Type (level 1) of the product.
google.protobuf.StringValue product_type_l1 = 44;
// Type (level 2) of the product.
google.protobuf.StringValue product_type_l2 = 45;
// Type (level 3) of the product.
google.protobuf.StringValue product_type_l3 = 46;
// Type (level 4) of the product.
google.protobuf.StringValue product_type_l4 = 47;
// Type (level 5) of the product.
google.protobuf.StringValue product_type_l5 = 48;
// Quarter as represented by the date of the first day of a quarter.
// Uses the calendar year for quarters, e.g., the second quarter of 2018
// starts on 2018-04-01. Formatted as yyyy-MM-dd.
google.protobuf.StringValue quarter = 21;
// Type of the search engine results page.
google.ads.googleads.v1.enums.SearchEngineResultsPageTypeEnum.SearchEngineResultsPageType search_engine_results_page_type = 70;
// Match type of the keyword that triggered the ad, including variants.
google.ads.googleads.v1.enums.SearchTermMatchTypeEnum.SearchTermMatchType search_term_match_type = 22;
// Position of the ad.
google.ads.googleads.v1.enums.SlotEnum.Slot slot = 23;
// Resource name of the ad group criterion that represents webpage criterion.
google.protobuf.StringValue webpage = 66;
// Week as defined as Monday through Sunday, and represented by the date of
// Monday. Formatted as yyyy-MM-dd.
google.protobuf.StringValue week = 24;
// Year, formatted as yyyy.
google.protobuf.Int32Value year = 25;
}
// A Keyword criterion segment.
message Keyword {
// The AdGroupCriterion resource name.
google.protobuf.StringValue ad_group_criterion = 1;
// Keyword info.
KeywordInfo info = 2;
}

@ -1,124 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "SimulationProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing simulation points.
// A container for simulation points for simulations of type BID_MODIFIER.
message BidModifierSimulationPointList {
// Projected metrics for a series of bid modifier amounts.
repeated BidModifierSimulationPoint points = 1;
}
// A container for simulation points for simulations of type CPC_BID.
message CpcBidSimulationPointList {
// Projected metrics for a series of cpc bid amounts.
repeated CpcBidSimulationPoint points = 1;
}
// A container for simulation points for simulations of type TARGET_CPA.
message TargetCpaSimulationPointList {
// Projected metrics for a series of target cpa amounts.
repeated TargetCpaSimulationPoint points = 1;
}
// Projected metrics for a specific bid modifier amount.
message BidModifierSimulationPoint {
// The simulated bid modifier upon which projected metrics are based.
google.protobuf.DoubleValue bid_modifier = 1;
// Projected number of biddable conversions.
google.protobuf.DoubleValue biddable_conversions = 2;
// Projected total value of biddable conversions.
google.protobuf.DoubleValue biddable_conversions_value = 3;
// Projected number of clicks.
google.protobuf.Int64Value clicks = 4;
// Projected cost in micros.
google.protobuf.Int64Value cost_micros = 5;
// Projected number of impressions.
google.protobuf.Int64Value impressions = 6;
// Projected number of top slot impressions.
google.protobuf.Int64Value top_slot_impressions = 7;
}
// Projected metrics for a specific cpc bid amount.
message CpcBidSimulationPoint {
// The simulated cpc bid upon which projected metrics are based.
google.protobuf.Int64Value cpc_bid_micros = 1;
// Projected number of biddable conversions.
google.protobuf.DoubleValue biddable_conversions = 2;
// Projected total value of biddable conversions.
google.protobuf.DoubleValue biddable_conversions_value = 3;
// Projected number of clicks.
google.protobuf.Int64Value clicks = 4;
// Projected cost in micros.
google.protobuf.Int64Value cost_micros = 5;
// Projected number of impressions.
google.protobuf.Int64Value impressions = 6;
// Projected number of top slot impressions.
// Display network does not support this field at the ad group level.
google.protobuf.Int64Value top_slot_impressions = 7;
}
// Projected metrics for a specific target cpa amount.
message TargetCpaSimulationPoint {
// The simulated target cpa upon which projected metrics are based.
google.protobuf.Int64Value target_cpa_micros = 1;
// Projected number of biddable conversions.
google.protobuf.DoubleValue biddable_conversions = 2;
// Projected total value of biddable conversions.
google.protobuf.DoubleValue biddable_conversions_value = 3;
// Projected number of clicks.
google.protobuf.Int64Value clicks = 4;
// Projected cost in micros.
google.protobuf.Int64Value cost_micros = 5;
// Projected number of impressions.
google.protobuf.Int64Value impressions = 6;
// Projected number of top slot impressions.
// Display network does not support this field at the ad group level.
google.protobuf.Int64Value top_slot_impressions = 7;
}

@ -1,52 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/tracking_code_page_format.proto";
import "google/ads/googleads/v1/enums/tracking_code_type.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "TagSnippetProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing TagSnippet
// The site tag and event snippet pair for a TrackingCodeType.
message TagSnippet {
// The type of the generated tag snippets for tracking conversions.
google.ads.googleads.v1.enums.TrackingCodeTypeEnum.TrackingCodeType type = 1;
// The format of the web page where the tracking tag and snippet will be
// installed, e.g. HTML.
google.ads.googleads.v1.enums.TrackingCodePageFormatEnum.TrackingCodePageFormat page_format = 2;
// The site tag that adds visitors to your basic remarketing lists and sets
// new cookies on your domain.
google.protobuf.StringValue global_site_tag = 3;
// The event snippet that works with the site tag to track actions that
// should be counted as conversions.
google.protobuf.StringValue event_snippet = 4;
}

@ -1,57 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/targeting_dimension.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "TargetingSettingProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing TargetingSetting
// Settings for the
// <a href="https://support.google.com/google-ads/answer/7365594">
// targeting related features</a>, at Campaign and AdGroup level.
message TargetingSetting {
// The per-targeting-dimension setting to restrict the reach of your campaign
// or ad group.
repeated TargetRestriction target_restrictions = 1;
}
// The list of per-targeting-dimension targeting settings.
message TargetRestriction {
// The targeting dimension that these settings apply to.
google.ads.googleads.v1.enums.TargetingDimensionEnum.TargetingDimension targeting_dimension = 1;
// Indicates whether to restrict your ads to show only for the criteria you
// have selected for this targeting_dimension, or to target all values for
// this targeting_dimension and show ads based on your targeting in other
// TargetingDimensions. A value of 'true' means that these criteria will only
// apply bid modifiers, and not affect targeting. A value of 'false' means
// that these criteria will restrict targeting as well as applying bid
// modifiers.
google.protobuf.BoolValue bid_only = 2;
}

@ -1,42 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "TextLabelProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// A type of label displaying text on a colored background.
message TextLabel {
// Background color of the label in RGB format. This string must match the
// regular expression '^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$'.
// Note: The background color may not be visible for manager accounts.
google.protobuf.StringValue background_color = 1;
// A short description of the label. The length must be no more than 200
// characters.
google.protobuf.StringValue description = 2;
}

@ -1,47 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "UrlCollectionProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file UrlCollection type.
// Collection of urls that is tagged with a unique identifier.
message UrlCollection {
// Unique identifier for this UrlCollection instance.
google.protobuf.StringValue url_collection_id = 1;
// A list of possible final URLs.
repeated google.protobuf.StringValue final_urls = 2;
// A list of possible final mobile URLs.
repeated google.protobuf.StringValue final_mobile_urls = 3;
// URL template for constructing a tracking URL.
google.protobuf.StringValue tracking_url_template = 4;
}

@ -1,293 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/ads/googleads/v1/enums/customer_match_upload_key_type.proto";
import "google/ads/googleads/v1/enums/user_list_combined_rule_operator.proto";
import "google/ads/googleads/v1/enums/user_list_crm_data_source_type.proto";
import "google/ads/googleads/v1/enums/user_list_date_rule_item_operator.proto";
import "google/ads/googleads/v1/enums/user_list_logical_rule_operator.proto";
import "google/ads/googleads/v1/enums/user_list_number_rule_item_operator.proto";
import "google/ads/googleads/v1/enums/user_list_prepopulation_status.proto";
import "google/ads/googleads/v1/enums/user_list_rule_type.proto";
import "google/ads/googleads/v1/enums/user_list_string_rule_item_operator.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "UserListsProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing user list types.
// SimilarUserList is a list of users which are similar to users from another
// UserList. These lists are read-only and automatically created by Google.
message SimilarUserListInfo {
// Seed UserList from which this list is derived.
google.protobuf.StringValue seed_user_list = 1;
}
// UserList of CRM users provided by the advertiser.
message CrmBasedUserListInfo {
// A string that uniquely identifies a mobile application from which the data
// was collected to the Google Ads API.
// For iOS, the ID string is the 9 digit string that appears at the end of an
// App Store URL (e.g., "476943146" for "Flood-It! 2" whose App Store link is
// http://itunes.apple.com/us/app/flood-it!-2/id476943146).
// For Android, the ID string is the application's package name
// (e.g., "com.labpixies.colordrips" for "Color Drips" given Google Play link
// https://play.google.com/store/apps/details?id=com.labpixies.colordrips).
// Required when creating CrmBasedUserList for uploading mobile advertising
// IDs.
google.protobuf.StringValue app_id = 1;
// Matching key type of the list.
// Mixed data types are not allowed on the same list.
// This field is required for an ADD operation.
google.ads.googleads.v1.enums.CustomerMatchUploadKeyTypeEnum.CustomerMatchUploadKeyType upload_key_type = 2;
// Data source of the list. Default value is FIRST_PARTY.
// Only whitelisted customers can create third-party sourced CRM lists.
google.ads.googleads.v1.enums.UserListCrmDataSourceTypeEnum.UserListCrmDataSourceType data_source_type = 3;
}
// A client defined rule based on custom parameters sent by web sites or
// uploaded by the advertiser.
message UserListRuleInfo {
// Rule type is used to determine how to group rule items.
//
// The default is OR of ANDs (disjunctive normal form).
// That is, rule items will be ANDed together within rule item groups and the
// groups themselves will be ORed together.
//
// Currently AND of ORs (conjunctive normal form) is only supported for
// ExpressionRuleUserList.
google.ads.googleads.v1.enums.UserListRuleTypeEnum.UserListRuleType rule_type = 1;
// List of rule item groups that defines this rule.
// Rule item groups are grouped together based on rule_type.
repeated UserListRuleItemGroupInfo rule_item_groups = 2;
}
// A group of rule items.
message UserListRuleItemGroupInfo {
// Rule items that will be grouped together based on rule_type.
repeated UserListRuleItemInfo rule_items = 1;
}
// An atomic rule fragment.
message UserListRuleItemInfo {
// Rule variable name. It should match the corresponding key name fired
// by the pixel.
// A name must begin with US-ascii letters or underscore or UTF8 code that is
// greater than 127 and consist of US-ascii letters or digits or underscore or
// UTF8 code that is greater than 127.
// For websites, there are two built-in variable URL (name = 'url__') and
// referrer URL (name = 'ref_url__').
// This field must be populated when creating a new rule item.
google.protobuf.StringValue name = 1;
// An atomic rule fragment.
oneof rule_item {
// An atomic rule fragment composed of a number operation.
UserListNumberRuleItemInfo number_rule_item = 2;
// An atomic rule fragment composed of a string operation.
UserListStringRuleItemInfo string_rule_item = 3;
// An atomic rule fragment composed of a date operation.
UserListDateRuleItemInfo date_rule_item = 4;
}
}
// A rule item composed of date operation.
message UserListDateRuleItemInfo {
// Date comparison operator.
// This field is required and must be populated when creating new date
// rule item.
google.ads.googleads.v1.enums.UserListDateRuleItemOperatorEnum.UserListDateRuleItemOperator operator = 1;
// String representing date value to be compared with the rule variable.
// Supported date format is YYYY-MM-DD.
// Times are reported in the customer's time zone.
google.protobuf.StringValue value = 2;
// The relative date value of the right hand side denoted by number of days
// offset from now. The value field will override this field when both are
// present.
google.protobuf.Int64Value offset_in_days = 3;
}
// A rule item composed of number operation.
message UserListNumberRuleItemInfo {
// Number comparison operator.
// This field is required and must be populated when creating a new number
// rule item.
google.ads.googleads.v1.enums.UserListNumberRuleItemOperatorEnum.UserListNumberRuleItemOperator operator = 1;
// Number value to be compared with the variable.
// This field is required and must be populated when creating a new number
// rule item.
google.protobuf.DoubleValue value = 2;
}
// A rule item fragment composed of date operation.
message UserListStringRuleItemInfo {
// String comparison operator.
// This field is required and must be populated when creating a new string
// rule item.
google.ads.googleads.v1.enums.UserListStringRuleItemOperatorEnum.UserListStringRuleItemOperator operator = 1;
// The right hand side of the string rule item. For URLs or referrer URLs,
// the value can not contain illegal URL chars such as newlines, quotes,
// tabs, or parentheses. This field is required and must be populated when
// creating a new string rule item.
google.protobuf.StringValue value = 2;
}
// User lists defined by combining two rules, left operand and right operand.
// There are two operators: AND where left operand and right operand have to be
// true; AND_NOT where left operand is true but right operand is false.
message CombinedRuleUserListInfo {
// Left operand of the combined rule.
// This field is required and must be populated when creating new combined
// rule based user list.
UserListRuleInfo left_operand = 1;
// Right operand of the combined rule.
// This field is required and must be populated when creating new combined
// rule based user list.
UserListRuleInfo right_operand = 2;
// Operator to connect the two operands.
//
// Required for creating a combined rule user list.
google.ads.googleads.v1.enums.UserListCombinedRuleOperatorEnum.UserListCombinedRuleOperator rule_operator = 3;
}
// Visitors of a page during specific dates.
message DateSpecificRuleUserListInfo {
// Boolean rule that defines visitor of a page.
//
// Required for creating a date specific rule user list.
UserListRuleInfo rule = 1;
// Start date of users visit. If set to 2000-01-01, then the list includes all
// users before end_date. The date's format should be YYYY-MM-DD.
//
// Required for creating a data specific rule user list.
google.protobuf.StringValue start_date = 2;
// End date of users visit. If set to 2037-12-30, then the list includes all
// users after start_date. The date's format should be YYYY-MM-DD.
//
// Required for creating a data specific rule user list.
google.protobuf.StringValue end_date = 3;
}
// Visitors of a page. The page visit is defined by one boolean rule expression.
message ExpressionRuleUserListInfo {
// Boolean rule that defines this user list. The rule consists of a list of
// rule item groups and each rule item group consists of a list of rule items.
// All the rule item groups are ORed or ANDed together for evaluation based on
// rule.rule_type.
//
// Required for creating an expression rule user list.
UserListRuleInfo rule = 1;
}
// Representation of a userlist that is generated by a rule.
message RuleBasedUserListInfo {
// The status of pre-population. The field is default to NONE if not set which
// means the previous users will not be considered. If set to REQUESTED, past
// site visitors or app users who match the list definition will be included
// in the list (works on the Display Network only). This will only
// add past users from within the last 30 days, depending on the
// list's membership duration and the date when the remarketing tag is added.
// The status will be updated to FINISHED once request is processed, or FAILED
// if the request fails.
google.ads.googleads.v1.enums.UserListPrepopulationStatusEnum.UserListPrepopulationStatus prepopulation_status = 1;
// Subtypes of rule based user lists.
oneof rule_based_user_list {
// User lists defined by combining two rules.
// There are two operators: AND, where the left and right operands have to
// be true; AND_NOT where left operand is true but right operand is false.
CombinedRuleUserListInfo combined_rule_user_list = 2;
// Visitors of a page during specific dates. The visiting periods are
// defined as follows:
// Between start_date (inclusive) and end_date (inclusive);
// Before end_date (exclusive) with start_date = 2000-01-01;
// After start_date (exclusive) with end_date = 2037-12-30.
DateSpecificRuleUserListInfo date_specific_rule_user_list = 3;
// Visitors of a page. The page visit is defined by one boolean rule
// expression.
ExpressionRuleUserListInfo expression_rule_user_list = 4;
}
}
// Represents a user list that is a custom combination of user lists.
message LogicalUserListInfo {
// Logical list rules that define this user list. The rules are defined as a
// logical operator (ALL/ANY/NONE) and a list of user lists. All the rules are
// ANDed when they are evaluated.
//
// Required for creating a logical user list.
repeated UserListLogicalRuleInfo rules = 1;
}
// A user list logical rule. A rule has a logical operator (and/or/not) and a
// list of user lists as operands.
message UserListLogicalRuleInfo {
// The logical operator of the rule.
google.ads.googleads.v1.enums.UserListLogicalRuleOperatorEnum.UserListLogicalRuleOperator operator = 1;
// The list of operands of the rule.
repeated LogicalUserListOperandInfo rule_operands = 2;
}
// Operand of logical user list that consists of a user list.
message LogicalUserListOperandInfo {
// Resource name of a user list as an operand.
google.protobuf.StringValue user_list = 1;
}
// User list targeting as a collection of conversions or remarketing actions.
message BasicUserListInfo {
// Actions associated with this user list.
repeated UserListActionInfo actions = 1;
}
// Represents an action type used for building remarketing user lists.
message UserListActionInfo {
// Subtypes of user list action.
oneof user_list_action {
// A conversion action that's not generated from remarketing.
google.protobuf.StringValue conversion_action = 1;
// A remarketing action.
google.protobuf.StringValue remarketing_action = 2;
}
}

@ -1,52 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.common;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/common;common";
option java_multiple_files = true;
option java_outer_classname = "ValueProto";
option java_package = "com.google.ads.googleads.v1.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Common";
option ruby_package = "Google::Ads::GoogleAds::V1::Common";
// Proto file describing value types
// A generic data container.
message Value {
// A value.
oneof value {
// A boolean.
bool boolean_value = 1;
// An int64.
int64 int64_value = 2;
// A float.
float float_value = 3;
// A double.
double double_value = 4;
// A string.
string string_value = 5;
}
}

@ -1,58 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AccessReasonProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Indicates the way the resource such as user list is related to a user.
message AccessReasonEnum {
// Enum describing possible access reasons.
enum AccessReason {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// The resource is owned by the user.
OWNED = 2;
// The resource is shared to the user.
SHARED = 3;
// The resource is licensed to the user.
LICENSED = 4;
// The user subscribed to the resource.
SUBSCRIBED = 5;
// The resource is accessible to the user.
AFFILIATED = 6;
}
}

@ -1,64 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AccountBudgetProposalStatusProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing AccountBudgetProposal statuses.
// Message describing AccountBudgetProposal statuses.
message AccountBudgetProposalStatusEnum {
// The possible statuses of an AccountBudgetProposal.
enum AccountBudgetProposalStatus {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// The proposal is pending approval.
PENDING = 2;
// The proposal has been approved but the corresponding billing setup
// has not. This can occur for proposals that set up the first budget
// when signing up for billing or when performing a change of bill-to
// operation.
APPROVED_HELD = 3;
// The proposal has been approved.
APPROVED = 4;
// The proposal has been cancelled by the user.
CANCELLED = 5;
// The proposal has been rejected by the user, e.g. by rejecting an
// acceptance email.
REJECTED = 6;
}
}

@ -1,57 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AccountBudgetProposalTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing AccountBudgetProposal types.
// Message describing AccountBudgetProposal types.
message AccountBudgetProposalTypeEnum {
// The possible types of an AccountBudgetProposal.
enum AccountBudgetProposalType {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Identifies a request to create a new budget.
CREATE = 2;
// Identifies a request to edit an existing budget.
UPDATE = 3;
// Identifies a request to end a budget that has already started.
END = 4;
// Identifies a request to remove a budget that hasn't started yet.
REMOVE = 5;
}
}

@ -1,54 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AccountBudgetStatusProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing AccountBudget statuses.
// Message describing AccountBudget statuses.
message AccountBudgetStatusEnum {
// The possible statuses of an AccountBudget.
enum AccountBudgetStatus {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// The account budget is pending approval.
PENDING = 2;
// The account budget has been approved.
APPROVED = 3;
// The account budget has been cancelled by the user.
CANCELLED = 4;
}
}

@ -1,57 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdCustomizerPlaceholderFieldProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing Ad Customizer placeholder fields.
// Values for Ad Customizer placeholder fields.
message AdCustomizerPlaceholderFieldEnum {
// Possible values for Ad Customizers placeholder fields.
enum AdCustomizerPlaceholderField {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Data Type: INT64. Integer value to be inserted.
INTEGER = 2;
// Data Type: STRING. Price value to be inserted.
PRICE = 3;
// Data Type: DATE_TIME. Date value to be inserted.
DATE = 4;
// Data Type: STRING. String value to be inserted.
STRING = 5;
}
}

@ -1,54 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdGroupAdRotationModeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing ad group ad rotation mode.
// Container for enum describing possible ad rotation modes of ads within an
// ad group.
message AdGroupAdRotationModeEnum {
// The possible ad rotation modes of an ad group.
enum AdGroupAdRotationMode {
// The ad rotation mode has not been specified.
UNSPECIFIED = 0;
// The received value is not known in this version.
//
// This is a response-only value.
UNKNOWN = 1;
// Optimize ad group ads based on clicks or conversions.
OPTIMIZE = 2;
// Rotate evenly forever.
ROTATE_FOREVER = 3;
}
}

@ -1,56 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdGroupAdStatusProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing ad group status.
// Container for enum describing possible statuses of an AdGroupAd.
message AdGroupAdStatusEnum {
// The possible statuses of an AdGroupAd.
enum AdGroupAdStatus {
// No value has been specified.
UNSPECIFIED = 0;
// The received value is not known in this version.
//
// This is a response-only value.
UNKNOWN = 1;
// The ad group ad is enabled.
ENABLED = 2;
// The ad group ad is paused.
PAUSED = 3;
// The ad group ad is removed.
REMOVED = 4;
}
}

@ -1,57 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdGroupCriterionApprovalStatusProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing approval status for the criterion.
// Container for enum describing possible AdGroupCriterion approval statuses.
message AdGroupCriterionApprovalStatusEnum {
// Enumerates AdGroupCriterion approval statuses.
enum AdGroupCriterionApprovalStatus {
// Not specified.
UNSPECIFIED = 0;
// The value is unknown in this version.
UNKNOWN = 1;
// Approved.
APPROVED = 2;
// Disapproved.
DISAPPROVED = 3;
// Pending Review.
PENDING_REVIEW = 4;
// Under review.
UNDER_REVIEW = 5;
}
}

@ -1,56 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdGroupCriterionStatusProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing AdGroupCriterion statuses.
// Message describing AdGroupCriterion statuses.
message AdGroupCriterionStatusEnum {
// The possible statuses of an AdGroupCriterion.
enum AdGroupCriterionStatus {
// No value has been specified.
UNSPECIFIED = 0;
// The received value is not known in this version.
//
// This is a response-only value.
UNKNOWN = 1;
// The ad group criterion is enabled.
ENABLED = 2;
// The ad group criterion is paused.
PAUSED = 3;
// The ad group criterion is removed.
REMOVED = 4;
}
}

@ -1,56 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdGroupStatusProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing ad group status.
// Container for enum describing possible statuses of an ad group.
message AdGroupStatusEnum {
// The possible statuses of an ad group.
enum AdGroupStatus {
// The status has not been specified.
UNSPECIFIED = 0;
// The received value is not known in this version.
//
// This is a response-only value.
UNKNOWN = 1;
// The ad group is enabled.
ENABLED = 2;
// The ad group is paused.
PAUSED = 3;
// The ad group is removed.
REMOVED = 4;
}
}

@ -1,82 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdGroupTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing ad group types.
// Defines types of an ad group, specific to a particular campaign channel
// type. This type drives validations that restrict which entities can be
// added to the ad group.
message AdGroupTypeEnum {
// Enum listing the possible types of an ad group.
enum AdGroupType {
// The type has not been specified.
UNSPECIFIED = 0;
// The received value is not known in this version.
//
// This is a response-only value.
UNKNOWN = 1;
// The default ad group type for Search campaigns.
SEARCH_STANDARD = 2;
// The default ad group type for Display campaigns.
DISPLAY_STANDARD = 3;
// The ad group type for Shopping campaigns serving standard product ads.
SHOPPING_PRODUCT_ADS = 4;
// The default ad group type for Hotel campaigns.
HOTEL_ADS = 6;
// The type for ad groups in Smart Shopping campaigns.
SHOPPING_SMART_ADS = 7;
// Short unskippable in-stream video ads.
VIDEO_BUMPER = 8;
// TrueView (skippable) in-stream video ads.
VIDEO_TRUE_VIEW_IN_STREAM = 9;
// TrueView in-display video ads.
VIDEO_TRUE_VIEW_IN_DISPLAY = 10;
// Unskippable in-stream video ads.
VIDEO_NON_SKIPPABLE_IN_STREAM = 11;
// Outstream video ads.
VIDEO_OUTSTREAM = 12;
// Ad group type for Dynamic Search Ads ad groups.
SEARCH_DYNAMIC_ADS = 13;
}
}

@ -1,63 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdNetworkTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing ad network types.
// Container for enumeration of Google Ads network types.
message AdNetworkTypeEnum {
// Enumerates Google Ads network types.
enum AdNetworkType {
// Not specified.
UNSPECIFIED = 0;
// The value is unknown in this version.
UNKNOWN = 1;
// Google search.
SEARCH = 2;
// Search partners.
SEARCH_PARTNERS = 3;
// Display Network.
CONTENT = 4;
// YouTube Search.
YOUTUBE_SEARCH = 5;
// YouTube Videos
YOUTUBE_WATCH = 6;
// Cross-network.
MIXED = 7;
}
}

@ -1,65 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdServingOptimizationStatusProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing ad serving statuses.
// Possible ad serving statuses of a campaign.
message AdServingOptimizationStatusEnum {
// Enum describing possible serving statuses.
enum AdServingOptimizationStatus {
// No value has been specified.
UNSPECIFIED = 0;
// The received value is not known in this version.
//
// This is a response-only value.
UNKNOWN = 1;
// Ad serving is optimized based on CTR for the campaign.
OPTIMIZE = 2;
// Ad serving is optimized based on CTR * Conversion for the campaign. If
// the campaign is not in the conversion optimizer bidding strategy, it will
// default to OPTIMIZED.
CONVERSION_OPTIMIZE = 3;
// Ads are rotated evenly for 90 days, then optimized for clicks.
ROTATE = 4;
// Show lower performing ads more evenly with higher performing ads, and do
// not optimize.
ROTATE_INDEFINITELY = 5;
// Ad serving optimization status is not available.
UNAVAILABLE = 6;
}
}

@ -1,63 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdStrengthProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing ad strengths.
// Container for enum describing possible ad strengths.
message AdStrengthEnum {
// Enum listing the possible ad strengths.
enum AdStrength {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// The ad strength is currently pending.
PENDING = 2;
// No ads could be generated.
NO_ADS = 3;
// Poor strength.
POOR = 4;
// Average strength.
AVERAGE = 5;
// Good strength.
GOOD = 6;
// Excellent strength.
EXCELLENT = 7;
}
}

@ -1,102 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing the ad type.
// Container for enum describing possible types of an ad.
message AdTypeEnum {
// The possible types of an ad.
enum AdType {
// No value has been specified.
UNSPECIFIED = 0;
// The received value is not known in this version.
//
// This is a response-only value.
UNKNOWN = 1;
// The ad is a text ad.
TEXT_AD = 2;
// The ad is an expanded text ad.
EXPANDED_TEXT_AD = 3;
// The ad is a call only ad.
CALL_ONLY_AD = 6;
// The ad is an expanded dynamic search ad.
EXPANDED_DYNAMIC_SEARCH_AD = 7;
// The ad is a hotel ad.
HOTEL_AD = 8;
// The ad is a Smart Shopping ad.
SHOPPING_SMART_AD = 9;
// The ad is a standard Shopping ad.
SHOPPING_PRODUCT_AD = 10;
// The ad is a video ad.
VIDEO_AD = 12;
// This ad is a Gmail ad.
GMAIL_AD = 13;
// This ad is an Image ad.
IMAGE_AD = 14;
// The ad is a responsive search ad.
RESPONSIVE_SEARCH_AD = 15;
// The ad is a legacy responsive display ad.
LEGACY_RESPONSIVE_DISPLAY_AD = 16;
// The ad is an app ad.
APP_AD = 17;
// The ad is a legacy app install ad.
LEGACY_APP_INSTALL_AD = 18;
// The ad is a responsive display ad.
RESPONSIVE_DISPLAY_AD = 19;
// The ad is a display upload ad with the HTML5_UPLOAD_AD product type.
HTML5_UPLOAD_AD = 21;
// The ad is a display upload ad with one of the DYNAMIC_HTML5_* product
// types.
DYNAMIC_HTML5_AD = 22;
// The ad is an app engagement ad.
APP_ENGAGEMENT_AD = 23;
}
}

@ -1,85 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdvertisingChannelSubTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing advertising channel subtypes.
// An immutable specialization of an Advertising Channel.
message AdvertisingChannelSubTypeEnum {
// Enum describing the different channel subtypes.
enum AdvertisingChannelSubType {
// Not specified.
UNSPECIFIED = 0;
// Used as a return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Mobile app campaigns for Search.
SEARCH_MOBILE_APP = 2;
// Mobile app campaigns for Display.
DISPLAY_MOBILE_APP = 3;
// AdWords express campaigns for search.
SEARCH_EXPRESS = 4;
// AdWords Express campaigns for display.
DISPLAY_EXPRESS = 5;
// Smart Shopping campaigns.
SHOPPING_SMART_ADS = 6;
// Gmail Ad campaigns.
DISPLAY_GMAIL_AD = 7;
// Smart display campaigns.
DISPLAY_SMART_CAMPAIGN = 8;
// Video Outstream campaigns.
VIDEO_OUTSTREAM = 9;
// Video TrueView for Action campaigns.
VIDEO_ACTION = 10;
// Video campaigns with non-skippable video ads.
VIDEO_NON_SKIPPABLE = 11;
// App Campaign that allows you to easily promote your Android or iOS app
// across Google's top properties including Search, Play, YouTube, and the
// Google Display Network.
APP_CAMPAIGN = 12;
// App Campaign for engagement, focused on driving re-engagement with the
// app across several of Googles top properties including Search, YouTube,
// and the Google Display Network.
APP_CAMPAIGN_FOR_ENGAGEMENT = 13;
}
}

@ -1,65 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AdvertisingChannelTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing advertising channel types
// The channel type a campaign may target to serve on.
message AdvertisingChannelTypeEnum {
// Enum describing the various advertising channel types.
enum AdvertisingChannelType {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Search Network. Includes display bundled, and Search+ campaigns.
SEARCH = 2;
// Google Display Network only.
DISPLAY = 3;
// Shopping campaigns serve on the shopping property
// and on google.com search results.
SHOPPING = 4;
// Hotel Ads campaigns.
HOTEL = 5;
// Video campaigns.
VIDEO = 6;
// App Campaigns, and App Campaigns for Engagement, that run
// across multiple channels.
MULTI_CHANNEL = 7;
}
}

@ -1,49 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AffiliateLocationFeedRelationshipTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing relation type for affiliate location feeds.
// Container for enum describing possible values for a relationship type for
// an affiliate location feed.
message AffiliateLocationFeedRelationshipTypeEnum {
// Possible values for a relationship type for an affiliate location feed.
enum AffiliateLocationFeedRelationshipType {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// General retailer relationship.
GENERAL_RETAILER = 2;
}
}

@ -1,78 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AffiliateLocationPlaceholderFieldProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing Affiliate Location placeholder fields.
// Values for Affiliate Location placeholder fields.
message AffiliateLocationPlaceholderFieldEnum {
// Possible values for Affiliate Location placeholder fields.
enum AffiliateLocationPlaceholderField {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Data Type: STRING. The name of the business.
BUSINESS_NAME = 2;
// Data Type: STRING. Line 1 of the business address.
ADDRESS_LINE_1 = 3;
// Data Type: STRING. Line 2 of the business address.
ADDRESS_LINE_2 = 4;
// Data Type: STRING. City of the business address.
CITY = 5;
// Data Type: STRING. Province of the business address.
PROVINCE = 6;
// Data Type: STRING. Postal code of the business address.
POSTAL_CODE = 7;
// Data Type: STRING. Country code of the business address.
COUNTRY_CODE = 8;
// Data Type: STRING. Phone number of the business.
PHONE_NUMBER = 9;
// Data Type: STRING. Language code of the business.
LANGUAGE_CODE = 10;
// Data Type: INT64. ID of the chain.
CHAIN_ID = 11;
// Data Type: STRING. Name of the chain.
CHAIN_NAME = 12;
}
}

@ -1,66 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AgeRangeTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing age range types.
// Container for enum describing the type of demographic age ranges.
message AgeRangeTypeEnum {
// The type of demographic age ranges (e.g. between 18 and 24 years old).
enum AgeRangeType {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Between 18 and 24 years old.
AGE_RANGE_18_24 = 503001;
// Between 25 and 34 years old.
AGE_RANGE_25_34 = 503002;
// Between 35 and 44 years old.
AGE_RANGE_35_44 = 503003;
// Between 45 and 54 years old.
AGE_RANGE_45_54 = 503004;
// Between 55 and 64 years old.
AGE_RANGE_55_64 = 503005;
// 65 years old and beyond.
AGE_RANGE_65_UP = 503006;
// Undetermined age range.
AGE_RANGE_UNDETERMINED = 503999;
}
}

@ -1,51 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AppCampaignAppStoreProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing App Campaign app store.
// The application store that distributes mobile applications.
message AppCampaignAppStoreEnum {
// Enum describing app campaign app store.
enum AppCampaignAppStore {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Apple app store.
APPLE_APP_STORE = 2;
// Google play.
GOOGLE_APP_STORE = 3;
}
}

@ -1,65 +0,0 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.ads.googleads.v1.enums;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Ads.GoogleAds.V1.Enums";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/enums;enums";
option java_multiple_files = true;
option java_outer_classname = "AppCampaignBiddingStrategyGoalTypeProto";
option java_package = "com.google.ads.googleads.v1.enums";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Enums";
option ruby_package = "Google::Ads::GoogleAds::V1::Enums";
// Proto file describing App Campaign bidding strategy goal types.
// Container for enum describing goal towards which the bidding strategy of an
// app campaign should optimize for.
message AppCampaignBiddingStrategyGoalTypeEnum {
// Goal type of App campaign BiddingStrategy.
enum AppCampaignBiddingStrategyGoalType {
// Not specified.
UNSPECIFIED = 0;
// Used for return value only. Represents value unknown in this version.
UNKNOWN = 1;
// Aim to maximize the number of app installs. The cpa bid is the
// target cost per install.
OPTIMIZE_INSTALLS_TARGET_INSTALL_COST = 2;
// Aim to maximize the long term number of selected in-app conversions from
// app installs. The cpa bid is the target cost per install.
OPTIMIZE_IN_APP_CONVERSIONS_TARGET_INSTALL_COST = 3;
// Aim to maximize the long term number of selected in-app conversions from
// app installs. The cpa bid is the target cost per in-app conversion. Note
// that the actual cpa may seem higher than the target cpa at first, since
// the long term conversions havent happened yet.
OPTIMIZE_IN_APP_CONVERSIONS_TARGET_CONVERSION_COST = 4;
// Aim to maximize all conversions' value, i.e. install + selected in-app
// conversions while achieving or exceeding target return on advertising
// spend.
OPTIMIZE_RETURN_ON_ADVERTISING_SPEND = 5;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save